Fix SearchKeysAsync database selection and RemoveByTagAsync tag cleanup#652
Merged
Conversation
… cleaning up tag keys (#651, #650) SearchKeysAsync was using IServer.ExecuteAsync("SCAN") which always scans DB0. Replaced with IServer.KeysAsync(database, pattern) which correctly targets the specified database. RemoveByTagAsync was deleting tagged data keys but not the tag Set key itself, leaving empty Sets in Redis indefinitely. Now deletes the tag key after removing its members. Bumped version to 12.2.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IServer.ExecuteAsync("SCAN")which always defaults to database 0, ignoring the database number fromDb1,Db2, etc. Replaced withIServer.KeysAsync(database, pattern, pageSize)which correctly targets the specified database. Fixes SearchKeysAsync ignores database number #651tag:{tagName}), causing empty Sets to accumulate in Redis indefinitely. Now deletes the tag key after removing its members. Fixes Tags are not disposed of #650Test plan
SearchKeysAsync_Should_Respect_Database_Number_Async— writes keys to DB1, verifies SearchKeys on DB1 returns only DB1 keysRemoveByTagAsync_ShouldDeleteTagKey_Async— verifies tag Set key is deleted after RemoveByTagAsync