Skip to content

mv tiered options

Matthew Von-Maszewski edited this page Apr 7, 2014 · 29 revisions

Status

  • merged to master
  • code complete April 7, 2013
  • development started April 6, 2014

WARNING!

  • This initial implementation does NOT automatically migrate data from a non-tiered configuration to a tiered configuration.
  • This initial implementation does NOT detect changes in tiered option parameters and migrate data from old configuration to new configuration.

The user must stop leveldb / Riak node and manually move leveldb .sst table files from one configuration to another. There is no manual activity required if starting a fresh database with the tiered configuration.

History / Context

Google's original leveldb implementation maintained all .sst table files in a single database directory. Riak 1.3 updated the leveldb code to place .sst tables file into subdirectories that represented the "level" of the file, i.e. sst_0, sst_1, … sst_6. The Riak 1.3 change focused on speeding database repair operations. But it had a side effect. Database operators could use the subdirectories to mount alternative storage devices at each level. The database operators had to manually create all the necessary directory links. This branch automates the process of using alternative storage arrays based upon levels.

The justification for two types/speeds of storage arrays is simple. leveldb is extremely write intensive in its lower levels. The write intensity drops off as the level number increases. Similarly, current and frequently updated data tends to be in lower levels while archival data tends to be in higher levels. These scenarios create desire to have faster, more expensive storage arrays for the higher intensity lower levels. This branch allows the high intensity lower levels to be on expensive storage arrays while slower, less expensive storage arrays to hold the higher level data to reduce costs.

Configuration / Usage

This branch introduces three configuration parameters that are only used when tiered storage is desired. The parameters assume the use of only two storage arrays: a fast array (primary) and a slow array (secondary).

leveldb option Riak 2.0 option Purpose
tiered_slow_level leveldb.tiered The level number where data should switch to slow array.
_0 is the default and disables this feature._
tiered_fast_prefix leveldb.tiered.mount.fast Path prefix for .sst files below tiered_slow_level
tiered_slow_prefix leveldb.tiered.mount.slow Path prefix for .sst files at and above tiered_slow_level

The full path for an .sst table file with tiered storage enabled:

Levels Resulting Path
0 to tier_slow_level-1 tiered_fast_prefix / database_name
tier_slow_level to 6 tiered_slow_prefix / database_name

The database_name is the name given in the DB::Open() call of leveldb. Riak 2.0 users know this as the leveldb.data_root option. Both uses of database_name need to be a relative path since either the fast or slow prefix option precedes it. A common relative path is ".".

Example Riak 2.0 configuration:

leveldb.data_root = .
leveldb.tiered = 4
leveldb.tiered.mount.fast = /mnt/fast_raid
leveldb.tiered.mount.slow = /mnt/slow_raid

Branch description

Clone this wiki locally