Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61f384f

Browse files
mniewrzalStorj Robot
authored andcommitted
satellite/metabase: partially revert optimizations for precommitDeleteUnversioned
Recently, we made some changes around precommitDeleteUnversioned. One, to reduce lock wait times during uploads. Second, to fix issue where committed object end up with negative version after copy/move operation or one more case where delete marker could have negative version. We mixed those changes as a one commit but now we need to revert only optimization because it has some weird side effects on Spanner. Change-Id: I87a5e7fe2fdbccd20b77068487fc845ce91de496
1 parent 4fbc4c8 commit 61f384f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

satellite/metabase/precommit.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (stx *spannerTransactionAdapter) precommitDeleteUnversioned(ctx context.Con
482482
SQL: `
483483
SELECT version, status
484484
FROM objects
485-
WHERE (project_id, bucket_name, object_key) = (@project_id, @bucket_name, @object_key) and version > 0
485+
WHERE (project_id, bucket_name, object_key) = (@project_id, @bucket_name, @object_key)
486486
ORDER BY version DESC
487487
LIMIT 1
488488
`,
@@ -513,7 +513,6 @@ func (stx *spannerTransactionAdapter) precommitDeleteUnversioned(ctx context.Con
513513
project_id = @project_id
514514
AND bucket_name = @bucket_name
515515
AND object_key = @object_key
516-
AND version > 0
517516
AND status IN ` + statusesUnversioned + `
518517
THEN RETURN stream_id, retention_mode, retain_until`,
519518
Params: map[string]any{

0 commit comments

Comments
 (0)