Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets#1935
Draft
kevin-montrose wants to merge 34 commits into
Draft
Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets#1935kevin-montrose wants to merge 34 commits into
kevin-montrose wants to merge 34 commits into
Conversation
… (as expected), but saved me some typing
…oing to require more serious work, so dropping a commit
19 tasks
…d to make sure we don't accidentally nest transactions
…empted) concurrent modification of the underlying key
…existing key (because that's how RI.CREATE works today, even if its a little strange for a Redis command)
… cleanup after an overwrite; little fixes for ETAG commands w.r.t. non-string records
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.
Most commands, when used on Vector Sets, should
WRONGTYPE. Similarly, Vector Set commands when used on non-Vector Set keys shouldWRONGTYPEWe have a bunch of commands, and we've been pretty laxidasical about checking
GarnetStatusso this is a pretty big PR, though mostly mechanical.Changes:
VCARDVISMEMBERVLINKS,VRANDMEMBER, andVSETATTR- far enough toWRONGTYPE`, but not fully implementedSET,MSET, etc.) correctly free up their resourcesOverwriting Vector Sets is a more complicated operation - if the value is still in memory, a IPU or CU needs a preceeding delete (because the
RecordTypeis changing; while if the value is on disk the blind upsert is fine, but we need to cleanup the Vector Set at some later point.My solution is to fail IPU/CU's with a
WRONG_TYPEresult and then retry in a transaction, and to implementICompactionFunctions.IsDeletedonGarnetRecordTypeto cleanup Vector Sets which are unreachable but not explicitly tombstone'd.This is approach is taken for:
MSETPSETEXSETSETEXSETIFGREATERSETIFMATCHSETWITHETAG