Skip to content

mv no md expiry

Matthew Von-Maszewski edited this page Nov 1, 2016 · 4 revisions

Status

  • merged to master - November 1, 2016
  • code complete - October 26, 2016
  • development started - October 25, 2016

History / Context

Basho's global expiry applies to every key within a database (a Riak vnode). Riak depends upon a special key to mark whether or not a database received a special upgrade in 2013. The special key would be subject to global expiry and logic depending upon that one key would break. This branch creates an exclusion for that one key.

Branch description

Only one source file changed to support the exclusion, leveldb_os/expiry_os.cc. It contains a simple memcmp() test for the key. The remaining source file changes relate to debug and unit test support for this branch.

db/dbformat.cc & .h

The function KeyTypeString() is a debug tool. It returns a pointer to a constant string that describes the key type. The function is first used in the debug tool sst_scan.

include/leveldb/options.h, leveldb_os/compile_opt.cc, util/options.cc

The function CompileOptionsString() is a simple tool for identifying compile time options within leveldb's LOG file. The initial implementation is a literal string.

This string is in response to a request from product management / client services.

leveldb_os/expiry_os.cc

MemTableInserterCallback() contains logic to convert a simple key into an expiry key. The "logic" is a simple "if" condition. That condition now includes a hard coded test for Riak's metadata key.

leveldb_os/expiry_os_test.cc

The new ExpiryDBTester::MetaDataKey test inserts exact replicas of a live metadata key and a live Riak bucket key. The test verifies that each of the keys gets appropriate treatment upon insert: metadata key is not converted for expiry and bucket is converted.

Clone this wiki locally