Skip to content

Commit

Permalink
WIP remove the only usage of InitPut with FailOnTombstones
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzefovich committed Dec 20, 2024
1 parent 951d890 commit 5ec42e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/sqlliveness/slstorage/slstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func (s *Storage) Insert(

}
v := encodeValue(expiration)
batch.InitPut(k, &v, true)
batch.InitPut(k, &v, false /* failOnTombstones */)

return txn.CommitInBatch(ctx, batch)
}); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/sql/sqlliveness/slstorage/slstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ func TestStorage(t *testing.T) {
require.False(t, exists)
require.Equal(t, int64(1), metrics.WriteFailures.Count())
}
// Ensure it cannot be inserted again.
{
require.Error(t, storage.Insert(ctx, id, exp))
}
})
t.Run("test-jitter", func(t *testing.T) {
// We want to test that the GC runs a number of times but is jitterred.
Expand Down

0 comments on commit 5ec42e3

Please sign in to comment.