Skip to content

Bump RocksDB from v7.10.2 to v8.9.1#66479

Merged
rschu1ze merged 2 commits intoClickHouse:masterfrom
rschu1ze:bump-rocksdb2
Aug 6, 2024
Merged

Bump RocksDB from v7.10.2 to v8.9.1#66479
rschu1ze merged 2 commits intoClickHouse:masterfrom
rschu1ze:bump-rocksdb2

Conversation

@rschu1ze
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-not-for-changelog This PR should not be mentioned in the changelog submodule changed At least one submodule changed in this PR. labels Jul 13, 2024
@robot-ch-test-poll4
Copy link
Copy Markdown
Contributor

robot-ch-test-poll4 commented Jul 13, 2024

This is an automated comment for commit d0bc728 with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@rschu1ze rschu1ze force-pushed the bump-rocksdb2 branch 2 times, most recently from 54eb448 to 7208fda Compare July 13, 2024 19:29
@rschu1ze rschu1ze changed the title (wip) Bump RocksDB from v7.10.2 to v8. (wip) Bump RocksDB from v7.10.2 to v8.9.1 Jul 13, 2024
@canhld94
Copy link
Copy Markdown
Contributor

canhld94 commented Jul 15, 2024

We have done this locally (but using v9.2.2 instead), I'm about to submit upstream PR then see this PR.
There's two backward incompatibility rocksdb option when upgrading rocksdb from current version to any version > 8.6.

  • rocksdb::BlockBasedTableOptions::checksum: 3 -> 4
  • rocksdb::BlockBasedTableOptions::format_version: 5 -> 6

Therefore we introduce two new settings for rocksdb table:

/* Advanced build-in rocksdb options */ \
M(UInt32, rocksdb_buildin_block_based_table_options_checksum, 3, "Checksum type for block based table options, see rocksdb::BlockBasedTableOptions::checksum", 0) \
M(UInt32, rocksdb_buildin_block_based_table_options_format_version, 5, "Version number for block based table options, see rocksdb::BlockBasedTableOptions::format_version", 0) \

To be set by default to same as current version for backward compatibility, when new version of rocksdb is stable then we will change these settings to new values.

It has been running for few weeks and I think the new rocksdb version (v9.2.2) is quite stable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe this is outdated now. We can link rocksdb to ch_contrib::jemalloc

@rschu1ze
Copy link
Copy Markdown
Member Author

@canhld94 As I am really a noob when it comes to RocksDB, I'd appreciate help 😄

Side note: An upgrade from 6.x to 7.10.2 is here and I'll try to get it merged this week.

What about this: Once the other PR is merged, we can remove the underlying two commits

image

... and then make this an upgrade to the latest RocksDB version you are using in your production (+ new settings if needed)?

@canhld94
Copy link
Copy Markdown
Contributor

@canhld94 As I am really a noob when it comes to RocksDB, I'd appreciate help 😄

Side note: An upgrade from 6.x to 7.10.2 is here and I'll try to get it merged this week.

What about this: Once the other PR is merged, we can remove the underlying two commits

image

... and then make this an upgrade to the latest RocksDB version you are using in your production (+ new settings if needed)?

@rschu1ze thanks, yes I'm willing to submit PR for rocksdb 9.2.2 upgrade.
Note that there is also backward incompatibility rocksdb option (rocksdb::BlockBasedTableOptions::checksum from 3->4) when upgrade to 7.10.2.

@rschu1ze
Copy link
Copy Markdown
Member Author

What you are saying is that #66475 is backward-incompatible without special settings?

In that case, please go ahead and kindly push your v6.x --> v9.2.2 upgrade. No need then to update rocksdb in small increments.

@canhld94
Copy link
Copy Markdown
Contributor

canhld94 commented Jul 15, 2024

What you are saying is that #66475 is backward-incompatible without special settings

Yes, in version 6.27.0 new hash type kXXH3 was added https://github.com/facebook/rocksdb/blob/main/HISTORY.md#new-features-30. Then in v7.8.0 kXXH3 was made default https://github.com/facebook/rocksdb/blob/main/HISTORY.md#public-api-changes-19. Current ClickHouse rocksdb version is 6.26, which doesn't support kXXH3.

@canhld94
Copy link
Copy Markdown
Contributor

What you are saying is that #66475 is backward-incompatible without special settings

Yes, in version 6.27.0 new hash type kXXH3 was added https://github.com/facebook/rocksdb/blob/main/HISTORY.md#new-features-30. Then in v7.8.0 kXXH3 was made default https://github.com/facebook/rocksdb/blob/main/HISTORY.md#public-api-changes-19. Current ClickHouse rocksdb version is 6.26, which doesn't support kXXH3.

Well may be saying backward-incompatible is incorrect. I mean it's a breaking change, once we upgrade then we cannot rollback.

@canhld94 canhld94 mentioned this pull request Jul 27, 2024
18 tasks
@rschu1ze rschu1ze changed the title (wip) Bump RocksDB from v7.10.2 to v8.9.1 Bump RocksDB from v7.10.2 to v8.9.1 Jul 31, 2024
@rschu1ze rschu1ze marked this pull request as ready for review July 31, 2024 15:24
@rschu1ze
Copy link
Copy Markdown
Member Author

@canhld94 We had some internal discussion based on above compatibility concerns. Turns out that there are two places in ClickHouse which use RocksDB: The EmbeddedRocksDB table engine, and RocksDB as a experimental backend of Keeper. The latter is disabled by default (docs, experimental_use_rocksdb). The former is disabled in ClickHouse Cloud but of course enabled in ClickHouse OSS.

I am really not against aforementioned compatibility settings which would enable a rollback but from our POV, such settings are not a priority. I'll continue upgrading RocksDB (to 8.9.1 in this PR, to the latest and greatest 9.5 in a follow-up PR). Feel free to submit compatibility settings separately on top (basically steal the corresponding bits from your PR) if that is important for you or you think others might benefit - I'll happily review and merge.

@canhld94
Copy link
Copy Markdown
Contributor

canhld94 commented Aug 1, 2024

@canhld94 We had some internal discussion based on above compatibility concerns. Turns out that there are two places in ClickHouse which use RocksDB: The EmbeddedRocksDB table engine, and RocksDB as a experimental backend of Keeper. The latter is disabled by default (docs, experimental_use_rocksdb). The former is disabled in ClickHouse Cloud but of course enabled in ClickHouse OSS.

I am really not against aforementioned compatibility settings which would enable a rollback but from our POV, such settings are not a priority. I'll continue upgrading RocksDB (to 8.9.1 in this PR, to the latest and greatest 9.5 in a follow-up PR). Feel free to submit compatibility settings separately on top (basically steal the corresponding bits from your PR) if that is important for you or you think others might benefit - I'll happily review and merge.

@rschu1ze for us it's not a big problem anymore, as we've verified the new version is good and certainly won't rollback (Btw in #67274 I just hardcode it, not exposing any setting).
Also you can take a look at the CMakelist file in #67274, besides refactoring, it also adds new feat (enables io_uring, using jemalloc...). Or may be I can submit it in a separate PR after you done upgrading?

@rschu1ze
Copy link
Copy Markdown
Member Author

rschu1ze commented Aug 1, 2024

@canhld94 Alright, thanks for the info. Yes, I'll definitely look at your CMakeLists for sure and most likely steal some pieces 😉. (So far, already stole your changes in StorageEmbeddedRocksDB.cpp about the new signature of GetBlockBasedTableOptionsFromMap.)

Let me proceed with the upgrade to latest RocksDB for now. Once done, we can enable the newer features you mentioned.

@hanfei1991 hanfei1991 self-assigned this Aug 6, 2024
@rschu1ze rschu1ze added this pull request to the merge queue Aug 6, 2024
Merged via the queue into ClickHouse:master with commit 4d44682 Aug 6, 2024
@rschu1ze rschu1ze deleted the bump-rocksdb2 branch August 6, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants