Bug #11034
closedGenericObjectMap::clear_header misuses KeyValueDB::rmkeys_by_prefix
0%
Description
The KeyValueDB interface seems to treat prefixes as true namespaces, and not simply prefixes prepended to the key. That is, the prefix-key pair "FooBar" - "Baz" is distinct from "Foo" - "BarBaz". (It's not 100% clear as the KeyValueDB interface is not documented yet to my knowledge.)
Likewise, the KeyValueDB::rmkeys_by_prefix function seems to be implemented as deleting only keys whose prefix is exactly equal to the given prefix. (At least, this is how the LevelDB backend seems to implement it.)
However, the GenericObjectMap::clear_header function invokes rmkeys_by_prefix on the non-existent prefix SEQ_xxxx, where xxxx is a sequence of digits. This appears to be an attempt to delete keys with all prefixes which start with _SEQ_xxxx: e.g., _SEQ_xxxx_STRIP, SEQ_xxxx_OBJATTR__.
This seems to affect at least v0.91 and later.
Attached is a patch which seems to fix this issue.
Files
Updated by Greg Farnum almost 7 years ago
- Status changed from New to Closed
This was part of KeyValueStore, which is dead.