Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure properly column families when using open_db_with_existing_cf #5105

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

agourlay
Copy link
Member

@agourlay agourlay commented Sep 18, 2024

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
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
17 checks passed
@agourlay agourlay deleted the configure-properly-column-families branch September 19, 2024 08:36
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