facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.

Home Page:http://rocksdb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling DB::open() with create_missing_column_families=true is quadratic

sadderchris opened this issue · comments

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

Per the notes here, when calling DB::open() with create_missing_column_families=true, column family creation is batched and takes a reasonable amount of time when opening a fresh database with lots of new column families.

Actual behavior

Calling DB::open() with create_missing_column_families=true doesn't actually batch create new column families and instead is quadratic in the number of column families it needs to create.

// missing column family, create it
ColumnFamilyHandle* handle = nullptr;
impl->mutex_.Unlock();
s = impl->CreateColumnFamily(cf.options, cf.name, &handle);
impl->mutex_.Lock();

Steps to reproduce the behavior

  1. Set options.create_missing_column_families = true
  2. Call DB::Open() on an empty directory and request to open a few hundred column families
  3. Observe that the time needed to open is between 30s - several minutes