Skip to content

Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets#1935

Draft
kevin-montrose wants to merge 34 commits into
mainfrom
users/kmontrose/vectorSetWrongTypeTests
Draft

Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets#1935
kevin-montrose wants to merge 34 commits into
mainfrom
users/kmontrose/vectorSetWrongTypeTests

Conversation

@kevin-montrose

@kevin-montrose kevin-montrose commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Most commands, when used on Vector Sets, should WRONGTYPE. Similarly, Vector Set commands when used on non-Vector Set keys should WRONGTYPE

We have a bunch of commands, and we've been pretty laxidasical about checking GarnetStatus so this is a pretty big PR, though mostly mechanical.

Changes:

  • Add tests for all Vector Set commands operating on non-Vector Set types
  • Implement VCARD
  • Implement VISMEMBER
  • Sketch out VLINKS, VRANDMEMBER, and VSETATTR- far enough toWRONGTYPE`, but not fully implemented
  • Add tests for (most) non-Vector Set commands on Vector Set keys
  • Add tests to validate the commands that overwrite Vector Sets (SET, MSET, etc.) correctly free up their resources

Overwriting Vector Sets is a more complicated operation - if the value is still in memory, a IPU or CU needs a preceeding delete (because the RecordType is 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_TYPE result and then retry in a transaction, and to implement ICompactionFunctions.IsDeleted on GarnetRecordType to cleanup Vector Sets which are unreachable but not explicitly tombstone'd.

This is approach is taken for:

  • MSET
  • PSETEX
  • SET
  • SETEX
  • SETIFGREATER
  • SETIFMATCH
  • SETWITHETAG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant