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

Fix exception on RocksDB.getColumnFamilyMetaData() #12474

Closed
wants to merge 1 commit into from

Conversation

rhubner
Copy link
Contributor

@rhubner rhubner commented Mar 25, 2024

#12466 reported a bug when RocksDB.getColumnFamilyMetaData() is called on an existing database(With files stored on disk). As @neilramaswamy mentioned, this was caused by #11770 where the signature of SstFileMetaData constructor was changed, but JNI code wasn't updated.

This PR fix JNI code, and also properly populate fileChecksum on SstFileMetaData.

}

try (final RocksDB db = RocksDB.open(options, dbFolder.getRoot().getAbsolutePath())) {
ColumnFamilyMetaData metadata = db.getColumnFamilyMetaData(); // Exception here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the reproduction that I had, it was only the second call to getColumnFamilyMetaData that would throw an exception. We might consider testing that case as well. But does this code also fail on 8.11.fb and 9.0.fb?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does this code also fail on 8.11.fb and 9.0.fb

You would need to test it. We are unlikely to backport this directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @neilramaswamy,

I was able to get the exception on first call. Didn't need the second one. As I mentioned, what is importand is the SST file on disk. This was the trigger for exception.

Radek

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would need to test it. We are unlikely to backport this directly

Yeah, I was more curious, wasn't expecting a backport. But I did verify that on 8.11.3 and 9.0.0 this test indeed fails. Thanks Radek!

I'm curious though, @adamretter, is this fix something that you would backport? I imagine that breaking getColumnFamilyMetaData calls for an SST file on disk could impact a lot of users.

@neilramaswamy
Copy link
Contributor

@rhubner, is this ready for review?

@rhubner
Copy link
Contributor Author

rhubner commented Mar 28, 2024

Hello @neilramaswamy,

@rhubner, is this ready for review?

Yes it is.

Radek

@neilramaswamy
Copy link
Contributor

neilramaswamy commented Mar 30, 2024

Perhaps @adamretter or @ajkr could take a look?

I also manually verified that these changes fix the original repro as I reported in #12466.

@adamretter
Copy link
Collaborator

@ajkr @pdillinger Please could you merge this to:

  1. main
  2. 8.11.fb
  3. 9.0.fb
  4. Thanks

nmaguiar added a commit to OpenAF/openaf-opacks that referenced this pull request Apr 2, 2024
@facebook-github-bot
Copy link
Contributor

@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ajkr merged this pull request in a8035eb.

ajkr pushed a commit that referenced this pull request Apr 9, 2024
Summary:
#12466 reported a bug when `RocksDB.getColumnFamilyMetaData()` is called on an existing database(With files stored on disk). As neilramaswamy mentioned, this was caused by #11770 where the signature of `SstFileMetaData` constructor was changed, but JNI code wasn't updated.

This PR fix JNI code, and also properly populate `fileChecksum` on `SstFileMetaData`.

Pull Request resolved: #12474

Reviewed By: jowlyzhang

Differential Revision: D55811808

Pulled By: ajkr

fbshipit-source-id: 2ab156f41eaf4a4f30c49e6df421b61e8451230e
ajkr pushed a commit that referenced this pull request Apr 9, 2024
Summary:
#12466 reported a bug when `RocksDB.getColumnFamilyMetaData()` is called on an existing database(With files stored on disk). As neilramaswamy mentioned, this was caused by #11770 where the signature of `SstFileMetaData` constructor was changed, but JNI code wasn't updated.

This PR fix JNI code, and also properly populate `fileChecksum` on `SstFileMetaData`.

Pull Request resolved: #12474

Reviewed By: jowlyzhang

Differential Revision: D55811808

Pulled By: ajkr

fbshipit-source-id: 2ab156f41eaf4a4f30c49e6df421b61e8451230e
@neilramaswamy
Copy link
Contributor

Thanks for the backport, Andrew! @adamretter are you the one who creates the artifact?

@adamretter
Copy link
Collaborator

@neilramaswamy it depends which artifact you mean? I built and published the binaries for RocksJava 8.11.4 to Maven Central yesterday.

@neilramaswamy
Copy link
Contributor

@adamretter, Ah, when I posted that it hadn't shown up on Maven Central yet. Thanks!

@neilramaswamy
Copy link
Contributor

@ajkr, FYI that I think that this might have been forgotten to be cherry-picked into 9.1.0. I see it in 8.11.fb and 9.0.fb, though.

ajkr pushed a commit that referenced this pull request Apr 22, 2024
Summary:
#12466 reported a bug when `RocksDB.getColumnFamilyMetaData()` is called on an existing database(With files stored on disk). As neilramaswamy mentioned, this was caused by #11770 where the signature of `SstFileMetaData` constructor was changed, but JNI code wasn't updated.

This PR fix JNI code, and also properly populate `fileChecksum` on `SstFileMetaData`.

Pull Request resolved: #12474

Reviewed By: jowlyzhang

Differential Revision: D55811808

Pulled By: ajkr

fbshipit-source-id: 2ab156f41eaf4a4f30c49e6df421b61e8451230e
@ajkr
Copy link
Contributor

ajkr commented Apr 22, 2024

@neilramaswamy Thanks for pointing that out. I will fix that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants