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

RockDB data portability (aka empty db issue) #1887

Closed
davidecaroselli opened this issue Feb 20, 2017 · 4 comments
Closed

RockDB data portability (aka empty db issue) #1887

davidecaroselli opened this issue Feb 20, 2017 · 4 comments

Comments

@davidecaroselli
Copy link

Hi team!

I'm experiencing some issues with RocksDB:

  1. I create a very small database on one machine, let's call it VM1.
  2. Stop any process that read/write on that db.
  3. SCP the entire db folder from one machine to another, VM2.
  4. And now it comes the problem: if I dump the db content with my binary, I get content only in VM1, and an "empty DB" on VM2.

More precisely my code does something like:

it = db->NewIterator();
it->SeekToFirst();

while (it->Valid()) {
   ...
}

Now the problem is that the line it->Valid() it's immediately false on VM2.

Do you know any good reason why I should not be able to do such operation?

Thank you!

@davidecaroselli
Copy link
Author

ops, almost forgot! This is the DB that is causing the issue: db.tar.gz and the version of rocksdb is 4.13.5

thanks!

@davidecaroselli
Copy link
Author

Just found the solution!
The problem was related to snappy library: rocksdb on VM1 was built with snappy, while rocksdb on VM2 not. When I tried to read the sst file with sst_dump on VM2 I get this error:

/.../000007.sst: Corruption: Snappy not supported or corrupted Snappy compressed block contents

May I suggest to throw this error at DB->Open() instead of silently fail?

Thanks!

@yiwu-arbug
Copy link
Contributor

DB->Open() don't actually read the sst file, but it->Status() should reveal the error. Does it work for you?

@davidecaroselli
Copy link
Author

yes, the issue arises if I use it->Status(). I was expecting database to be "readable" after db->Open(), my mistake!

Thanks!

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