Skip to content

Configure properly column families when using open_db_with_existing_cf - #5105

Merged
agourlay merged 1 commit into
devfrom
configure-properly-column-families
Sep 19, 2024
Merged

agourlay merged 1 commit into
devfrom
configure-properly-column-families

Conversation

@agourlay

@agourlay agourlay commented Sep 18, 2024 •

Copy link
Copy Markdown
Member

We have configured RocksDB to create missing column families opened.

 options.create_missing_column_families(true);

There are two ways to open a column family, first open_cf:

    /// Opens a database with the given database options and column family names.
    ///
    /// Column families opened using this function will be created with default `Options`.
    pub fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>

Which only configure the database using the Options

Whereas open_cf_with_opts:

    /// Opens a database with the given database options and column family names.
    ///
    /// Column families opened using given `Options`.
    pub fn open_cf_with_opts<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>

which also applies the Options to the column family.

This means all column families created with open_db_with_existing_cf are not configured.

This is visible with payload_index CFs not using lz4 for compression.

@agourlay
agourlay marked this pull request as ready for review September 18, 2024 15:13
@timvisee

Copy link
Copy Markdown
Member

I've tested this locally as well. It properly updates the compression scheme for existing payload_index databases to LZ4, as we expect. 👍

Thanks!

@agourlay
agourlay merged commit 7fe546b into dev Sep 19, 2024
@agourlay
agourlay deleted the configure-properly-column-families branch September 19, 2024 08:36
@timvisee timvisee mentioned this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants