-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node/metabase: Prevent value disorder in plain attribute index
Previously, since attributes were stored in PREFIX_KEY_DELIM_VAL_OID format, the lexicographic order of values could be violated. For example, if two objects had the same attribute with values '1' and '1a', and the 1st one had OID starting from byte > 'a', they were stored in the meta bucket in reverse order. Keeping natural order is essential for the DB iterator's effectiveness for sorted SearchV2. This extends storage scheme with zero byte delimiter b/w VAL and OID. It can be a delimiter since none VAL can include it. At the same time, it preserves the order and resolves mentioned problem. The original separator was 0xFF as an invalid UTF-8 the 0xFF byte was banned. In order not to have two different separators, KEY and VAL are now also separated by 0x00. Any attempt to write metadata with a zero byte in the attributes will now fail. Although with 53b3c86 such an object cannot come from the upper-level object service, relying only on it is risky: migration already works without it, and the metadata limits are critical to the SearchV2 provision. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
- Loading branch information
1 parent
27f63e9
commit 5d8fa17
Showing
7 changed files
with
185 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.