Don't use transaction in ListModifiedSince. (#110392)

* Don't use transaction in ListModifiedSince.

To guarantee that we don't include events with RV > LatestRV, we include the check in SQL query instead.

* Fix integration test by converting SQL comments into template comments.
This commit is contained in:
Peter Štibraný
2025-09-01 11:39:02 +02:00
committed by GitHub
parent 31114fb47c
commit da43e2ae07
7 changed files with 20 additions and 42 deletions
+5 -1
View File
@@ -432,7 +432,8 @@ type sqlResourceListModifiedSinceRequest struct {
Namespace string
Group string
Resource string
SinceRv int64
SinceRv int64 // Exclusive
LatestRv int64 // Inclusive
}
func (r sqlResourceListModifiedSinceRequest) Validate() error {
@@ -448,5 +449,8 @@ func (r sqlResourceListModifiedSinceRequest) Validate() error {
if r.SinceRv < 0 {
return fmt.Errorf("since resource version must be greater than or equal to zero")
}
if r.LatestRv < r.SinceRv {
return fmt.Errorf("latest resource version must be greater or equal to since resource version")
}
return nil
}