unified-storage: Skip query when ListModifiedSince cannot return anything. (#110338)

* Skip query when ListModifiedSince cannot return anything.

* Only save listRV if it's different than sinceRV. This saves a disk access if not needed.

* Add test for ListModifiedSince with same RV.
This commit is contained in:
Peter Štibraný
2025-08-29 14:49:20 +02:00
committed by GitHub
parent e3f5a65372
commit 3a3ba483b1
3 changed files with 44 additions and 10 deletions
+1 -1
View File
@@ -1273,7 +1273,7 @@ func (b *bleveIndex) updateIndexWithLatestModifications(ctx context.Context, req
startTime := time.Now()
listRV, docs, err := b.updaterFn(ctx, b, sinceRV)
if err == nil && listRV > 0 {
if err == nil && listRV > 0 && listRV != sinceRV {
err = b.updateResourceVersion(listRV) // updates b.resourceVersion
}