GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Upgrade RocksDB to version 9.2.1 by dlg99 · Pull Request #4422 · apache/bookkeeper

Conversation

@dlg99

@dlg99 dlg99 commented Jun 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Descriptions of the changes in this PR:

Fix #4409

Motivation

Upgrade RocksDB to v.9.2.1 to pick up latest performance and stability improvements and fixes in deleteRanges.
Hopefully deleteRanges() is stable enough for us to try again perf improvements #3653 that were reverted previously.

Changes

Changed RocksDB version, updated code to use changed API.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dlg99
dlg99 requested review from hangc0276 and hezhangjian June 7, 2024 15:32
hezhangjian
hezhangjian approved these changes Jun 8, 2024
View reviewed changes
hangc0276
hangc0276 requested changes Jun 8, 2024
View reviewed changes

@hangc0276 hangc0276 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Have you verified any compatible issues from 6.16.x to 9.2.1 and 7.x to 9.2.1?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hangc0276 hangc0276 assigned dlg99 Jun 8, 2024
@dlg99

dlg99 commented Jun 9, 2024

Copy link
Copy Markdown
Contributor Author

Have you verified any compatible issues from 6.16.x to 9.2.1 and 7.x to 9.2.1?

@hangc0276 I fixed/updated backward compat tests, that's it. If these aren't enough we need to invest some time into these kinds of tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dlg99
dlg99 force-pushed the rocksdb921 branch from 932b0c0 to 63047f4 Compare June 18, 2024 15:43
@dlg99

dlg99 commented Jun 18, 2024

Copy link
Copy Markdown
Contributor Author

@hangc0276 I rebased after the merge of downgrade compat tests; upgrade to 9.2.1 doesn't downgrade nicely. I am not yet sure what can be configured to support compatibility.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Aug 15, 2024

Copy link
Copy Markdown
Member

@hangc0276 I rebased after the merge of downgrade compat tests; upgrade to 9.2.1 doesn't downgrade nicely. I am not yet sure what can be configured to support compatibility.

In RocksDB 9.0.0 release notes there's "format_version=6 is the new default setting in BlockBasedTableOptions, for more robust data integrity checking. DBs and SST files written with this setting cannot be read by RocksDB versions before 8.6.0."

@dlg99 Perhaps setting dbStorage_rocksDB_format_version=5 instead of dbStorage_rocksDB_format_version=2 could help solve this issue? It seems that format_version=2 is really old and doesn't support many optimizations.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Aug 15, 2024

Copy link
Copy Markdown
Member

I created an issue #4479 about upgrading the default format_version to 5.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Aug 15, 2024

Copy link
Copy Markdown
Member

I created PR #4480 to upgrade default format_version to 5.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari lhotari mentioned this pull request Aug 15, 2024
Set default format_version to 5 for RocksDB databases #4480
Merged
@hangc0276

hangc0276 commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

@lhotari Have you tested the downgrade? We set the format_version to 2 by default, and it may not impacted by version 6

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Aug 19, 2024

Copy link
Copy Markdown
Member

@lhotari Have you tested the downgrade? We set the format_version to 2 by default, and it may not impacted by version 6

@hangc0276 The format_version setting was missing for conf/ledger_metadata_rocksdb.conf. that's been a problem previously. I haven't tested it yet.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hangc0276

hangc0276 commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

@lhotari Have you tested the downgrade? We set the format_version to 2 by default, and it may not impacted by version 6

@hangc0276 The format_version setting was missing for conf/ledger_metadata_rocksdb.conf. that's been a problem previously. I haven't tested it yet.

@lhotari It is set to 2

  • bookkeeper/conf/entry_location_rocksdb.conf.default

    Lines 62 to 63 in 8890a61

    # set by jni: tableOptions.setFormatVersion
    format_version=2
  • https://github.com/apache/pulsar/blob/7636e8989f4d3fc24fce69a356d54e1c550945ed/conf/entry_location_rocksdb.conf#L61-L62
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Aug 19, 2024

Copy link
Copy Markdown
Member

@lhotari It is set to 2

  • bookkeeper/conf/entry_location_rocksdb.conf.default

    Lines 62 to 63 in 8890a61

    # set by jni: tableOptions.setFormatVersion
    format_version=2
  • https://github.com/apache/pulsar/blob/7636e8989f4d3fc24fce69a356d54e1c550945ed/conf/entry_location_rocksdb.conf#L61-L62

@hangc0276 Yes, you are right that format_version should already be set to 2.
I was assuming that the ledger metadata database would have been the problem. However, when conf/entry_location_rocksdb.conf is missing, the format_version set in code would get used.
(logic

bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java

Lines 126 to 140 in f048e7a

if (dbConfigType == DbConfigType.EntryLocation) {
dbFilePath = conf.getEntryLocationRocksdbConf();
} else if (dbConfigType == DbConfigType.LedgerMetadata) {
dbFilePath = conf.getLedgerMetadataRocksdbConf();
} else {
dbFilePath = conf.getDefaultRocksDBConf();
}
log.info("Searching for a RocksDB configuration file in {}", dbFilePath);
if (Paths.get(dbFilePath).toFile().exists()) {
log.info("Found a RocksDB configuration file and using it to initialize the RocksDB");
db = initializeRocksDBWithConfFile(basePath, subPath, dbConfigType, conf, readOnly, dbFilePath);
} else {
log.info("Haven't found the file and read the configuration from the main bookkeeper configuration");
db = initializeRocksDBWithBookieConf(basePath, subPath, dbConfigType, conf, readOnly);
}
)
By default in BK, the file is missing since the provide file is conf/entry_location_rocksdb.conf.default and that has no impact.

However, since format_version 2 is ancient, you never know if it starts causing problems when continuing to use it with RocskDB 9.x+. I haven't yet investigated the problem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dlg99 added 3 commits August 19, 2024 10:38
@dlg99
Upgrade RocksDB to version 9.2.1
5f6e259
@dlg99
trying compatibility setings to support downgrade
1014371
@dlg99
another try
3520340
@dlg99
dlg99 force-pushed the rocksdb921 branch from a60cccf to 3520340 Compare August 19, 2024 17:53
@dlg99
another try
f41c27b
@lhotari lhotari mentioned this pull request Oct 5, 2024
Please update the rocksdbjni jar to 9.6.1 apache/pulsar#23402
Closed
1 of 2 tasks
@yurivict

yurivict commented Oct 6, 2024

Copy link
Copy Markdown

RocksDB is now at 9.6.1.

Can this PR be updated to 9.6.1 and merged?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StevenLuMT

StevenLuMT commented Feb 17, 2025

Copy link
Copy Markdown
Member

PRs that have not been processed for a long time will be closed first. Please open them yourself if necessary.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StevenLuMT StevenLuMT closed this Feb 17, 2025
@lhotari lhotari mentioned this pull request Mar 5, 2025
Ensure that formatVersion is specified for all RocksDB databases #4559
Merged
@lhotari lhotari reopened this Mar 5, 2025
@lhotari

lhotari commented Mar 5, 2025

Copy link
Copy Markdown
Member

@hangc0276 I rebased after the merge of downgrade compat tests; upgrade to 9.2.1 doesn't downgrade nicely. I am not yet sure what can be configured to support compatibility.

@dlg99 It seems that format version wasn't specified for all databases in Bookkeeper. #4559 will address that for the cases where configuration isn't read from the configuration files. In master branch, reading from configuration files has been broken since #4407 and that's fixed in #4560. After these are merged, it would make sense to resume this PR. Are you interested in continuing this work? Perhaps we could bump directly to latest 9.x of RocksDB, 9.10.0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hangc0276

hangc0276 commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

@hangc0276 I rebased after the merge of downgrade compat tests; upgrade to 9.2.1 doesn't downgrade nicely. I am not yet sure what can be configured to support compatibility.

@dlg99 It seems that format version wasn't specified for all databases in Bookkeeper. #4559 will address that for the cases where configuration isn't read from the configuration files. In master branch, reading from configuration files has been broken since #4407 and that's fixed in #4560. After these are merged, it would make sense to resume this PR. Are you interested in continuing this work? Perhaps we could bump directly to latest 9.x of RocksDB, 9.10.0

@lhotari We should hold on to the upgrade before verifying the compatibility issue.
#4559 set formatVersion to 5. Does it mean all the old BookKeeper versions are need to upgrade to a version that contains #4559, and then upgrade to the version that upgraded RocksDB to 9.x?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Mar 22, 2025

Copy link
Copy Markdown
Member

@lhotari We should hold on to the upgrade before verifying the compatibility issue.
#4559 set formatVersion to 5. Does it mean all the old BookKeeper versions are need to upgrade to a version that contains #4559, and then upgrade to the version that upgraded RocksDB to 9.x?

@hangc0276 No, it doesn't mean that. formatVersion 5 has been around for a long time. The problem was that not all databases had the formatVersion set and that caused the problem in downgrading, since format 6 is the default since 8.8 (IIRC) unless explicitly set.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Apr 16, 2025

Copy link
Copy Markdown
Member

Superseded by #4580

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari lhotari closed this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hangc0276 hangc0276 hangc0276 requested changes
@hezhangjian hezhangjian hezhangjian approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dlg99 dlg99

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Task: upgrade RocksDB

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@dlg99 @lhotari @hangc0276 @yurivict @StevenLuMT @hezhangjian
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.