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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user