KAFKA-18462: Upgrade RocksDB dependency from 9.7.3 to 10.1.3#19880
Conversation
|
Executed the following command to run the Streams tests: TC_PATHS="tests/kafkatest/tests/streams" bash tests/docker/run_tests.shTest summaryAll tests passed except for one flaky case: This test passed after a retry. Flaky test rerun summary |
|
Gentle ping @ableegoldman, @cadonna, @mjsax. I'm not entirely sure about the upgrade policy for RocksDB in Streams, so I'm unsure whether upgrading to 10.2.1 is acceptable. This upgrade requires removing two options, as mentioned in the PR description. Alternatively, I could switch to a different version, such as 9.10.0, where both options are still supported. Would appreciate your thoughts on this. |
cadonna
left a comment
There was a problem hiding this comment.
Thanks for the PR @brandboat !
I left some comments!
You also need to update the tests in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest.
Could you also verify if options were deprecated in the Java API and in the C++ code. For the latter, I do not actually not know where to look. Maybe in the release notes. I am asking this because it seems that RocksDB's Java API contains options that were deprecated long ago in the C++ code. Maybe we can deprecate those options in our wrapper.
| @Override | ||
| public Options setRandomAccessMaxBufferSize(final long randomAccessMaxBufferSize) { | ||
| dbOptions.setRandomAccessMaxBufferSize(randomAccessMaxBufferSize); | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public long randomAccessMaxBufferSize() { | ||
| return dbOptions.randomAccessMaxBufferSize(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Unfortunately, we cannot simply remove these methods since they are kind of part of the public API. Could you please deprecate the methods and log a warn message?
Could you add the link to the PR that removes this option in the warn message?
There was a problem hiding this comment.
I just realized I had pasted the wrong link to the RocksDB commit 🤦. The original commit was actually reverted and later re-submitted. Here's the correct one:
https://github.com/facebook/rocksdb/pull/13288/files#diff-1536c1746bb06ab2e37be82324b437afc6b0ee159394d0d2c804532515f5a70a
(I’ve also updated the link in the PR description.)
This option is deprecated in the C++ code but has been removed entirely from the Java library.
There was a problem hiding this comment.
BTW random_access_max_buffer_size is a windows specific option, and have no effect in linux, as mentioned in facebook/rocksdb@cdad04b.
Remove double buffering on RandomRead on Windows.
With more logic appear in file reader/write Read no longer
obeys forwarding calls to Windows implementation.
Previously direct_io (unbuffered) was only available on Windows
but now is supported as generic.
We remove intermediate buffering on Windows.
Remove random_access_max_buffer_size option which was windows specific.
Non-zero values for that opton introduced unnecessary lock contention.
Remove Env::EnableReadAhead(), Env::ShouldForwardRawRequest() that are
no longer necessary.
Add aligned buffer reads for cases when requested reads exceed read ahead size.
This option no long take effect since rocksdb 5.4, I'll mark both method setRandomAccessMaxBufferSize and randomAccessMaxBufferSize deprecated and add warning message.
| @Override | ||
| public Options setMaxWriteBufferNumberToMaintain(final int maxWriteBufferNumberToMaintain) { | ||
| columnFamilyOptions.setMaxWriteBufferNumberToMaintain(maxWriteBufferNumberToMaintain); | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public int maxWriteBufferNumberToMaintain() { | ||
| return columnFamilyOptions.maxWriteBufferNumberToMaintain(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Same here.
But here it is even a bit more complicated. It seems that the option that replaces this option (max_write_buffer_size_to_maintain) does not exist in the Java API. That means, we cannot state in the warn message to use the other option instead. Could you please research why max_write_buffer_size_to_maintain does not exist in the Java API? RocksDB's mailing list is a good place to start the research.
There was a problem hiding this comment.
@cadonna, sorry for the late reply, you're right, this is indeed an issue in RocksDB. I've filed a GitHub issue to track it: facebook/rocksdb#13680.
There was a problem hiding this comment.
Given this breaking change, we might want to consider using a different version instead. For example, v10.1.3 still retains the MaxWriteBufferNumberToMaintain option.
There was a problem hiding this comment.
I find upgrading to 10.1.3 a good idea since it is the highest patch version of the penultimate minor release. They are usually a good compromise between robustness and improvements.
| log.warn("rate_limiter has been deprecated in RocksDB v7.6.0." + | ||
| " See https://github.com/facebook/rocksdb/pull/10378"); |
There was a problem hiding this comment.
Could you also verify if options were deprecated in the Java API and in the C++ code. For the latter, I do not actually not know where to look. Maybe in the release notes. I am asking this because it seems that RocksDB's Java API contains options that were deprecated long ago in the C++ code. Maybe we can deprecate those options in our wrapper.
I've checked
- https://github.com/facebook/rocksdb/blame/v10.1.3/options/db_options.cc
- https://github.com/facebook/rocksdb/blob/v10.1.3/options/cf_options.cc
and collected all options marked as kdeprecated. According to the definitions in
https://github.com/facebook/rocksdb/blob/57a8e69d4e75c317f6ab02d6fc2fdd404b366794/include/rocksdb/utilities/options_type.h#L73-L77
kDeprecated, // The option is no longer used in rocksdb. The RocksDB
// OptionsParser will still accept this option if it
// happen to exists in some Options file. However,
// the parser will not include it in serialization
// and verification processes.
Among the two options files, rate_limiter is the only deprecated option (since v7.6.0) that is still exposed in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java, and it does not have an alternative. Therefore, I'm adding @Deprecated to this option.
|
Executed the following command to run the Streams tests: TC_PATHS="tests/kafkatest/tests/streams" bash tests/docker/run_tests.shTest summary, 3 flaky tests
kafkatest.tests.streams.streams_broker_bounce_test.StreamsBrokerBounceTest.test_broker_type_bounce.failure_mode=clean_bounce.broker_type=leader.num_threads=3.sleep_time_secs=120.metadata_quorum=COMBINED_KRAFT.group_protocol=classickafkatest.tests.streams.streams_broker_down_resilience_test.StreamsBrokerDownResilience.test_streams_should_failover_while_brokers_down.metadata_quorum=COMBINED_KRAFT.group_protocol=streamskafkatest.tests.streams.streams_broker_bounce_test.StreamsBrokerBounceTest.test_broker_type_bounce.failure_mode=hard_shutdown.broker_type=leader.num_threads=3.sleep_time_secs=120.metadata_quorum=COMBINED_KRAFT.group_protocol=streamsExecuted the following command to rerun flaky tests, and all tests passed: Test summary, AC |
cadonna
left a comment
There was a problem hiding this comment.
Thanks for the updates!
LGTM!
|
Gentle ping @cadonna, should I open a PR against the 4.1 branch as well? |
|
I would not open a PR against |
|
I opened #22619 to address this. The details are in the PR; happy to adjust based on what you'd prefer. |
Upgraded RocksDB from 9.7.3 to 10.1.3, deprecate two configuration in
RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.javafacebook/rocksdb@541761e)
facebook/rocksdb@25cc564)
Add one configuration:
facebook/rocksdb@9b1d0c0)
Reviewers: Bruno Cadonna cadonna@apache.org, wilmerdooley wilmer@snovon.com