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

There is an bug with CreateColumnFamilyWithImport #12905

Open
zaorangyang opened this issue Aug 1, 2024 · 2 comments
Open

There is an bug with CreateColumnFamilyWithImport #12905

zaorangyang opened this issue Aug 1, 2024 · 2 comments

Comments

@zaorangyang
Copy link
Contributor

I'll start by describing my use case. I use ExportColumnFamily to export data from one database, let's call it DB1, as a backup. Then, I create a completely new and empty database on another machine that I call DB2. I use db->CreateColumnFamilyWithImport to import all column families from DB1. However, when I try to import the default column family, RocksDB reports an error similar to 'default column family already exists.' Here lies a contradiction, because for RocksDB, when you open a database handle, you must have a default column family, even if the database is completely empty.

@jowlyzhang
Copy link
Contributor

If this is something you really need, we have a feature working in progress that could suite you. This feature supports the user to swap a set of files into an existing column family to replace its existing data atomically. But for the CreateColumnFamilyWithImport API, I think it's logical that it doesn't support create the default column family. Since you cannot create the default column family with the CreateColumnFamily API either.

@zaorangyang zaorangyang changed the title There is a bug with CreateColumnFamilyWithImport There is an bug with CreateColumnFamilyWithImport Aug 2, 2024
@zaorangyang
Copy link
Contributor Author

Thanks for your reply. Atomic replacement of column families, this feature sounds great. However, in my opinion, the current behavior of the CreateColumnFamilyWithImport API is incomplete in a way. If there are no current plans to support using CreateColumnFamilyWithImport to import the default column family, it would be better to mention this detail in the documentation to prevent confusion for other users.

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

No branches or pull requests

2 participants