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

[FLINK-35579] update frocksdb version to v8.10.0 #25253

Merged
merged 8 commits into from
Aug 29, 2024

Conversation

mayuehappy
Copy link
Contributor

What is the purpose of the change

(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)

Brief change log

(for example:)

  • The TaskInfo is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • TaskManagers retrieve the TaskInfo from the blob cache

Verifying this change

Please make sure both new and modified tests in this PR follow the conventions for tests defined in our code quality guide.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (100MB)
  • Extended integration test for recovery after master (JobManager) failure
  • Added test that validates that TaskInfo is transferred only once across recoveries
  • Manually verified the change by running a 4 node cluster with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 26, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@mayuehappy
Copy link
Contributor Author

@flinkbot run azure

@Zakelly
Copy link
Contributor

Zakelly commented Aug 26, 2024

Is the CI failure related with compilation or release of the frocksdb?

@mayuehappy
Copy link
Contributor Author

Is the CI failure related with compilation or release of the frocksdb?

@Zakelly The compilation looks fine
There are two main reasons why CI has failed
The error message for one is open db

Caused by: org.rocksdb.RocksDBException: `/dev/null' exists but is not a directory
Aug 26 06:55:21 	at org.rocksdb.RocksDB.open(Native Method) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.rocksdb.RocksDB.open(RocksDB.java:315) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.apache.flink.contrib.streaming.state.RocksDBOperationUtils.openDB(RocksDBOperationUtils.java:77) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.apache.flink.contrib.streaming.state.restore.RocksDBHandle.loadDb(RocksDBHandle.java:138) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.apache.flink.contrib.streaming.state.restore.RocksDBHandle.openDB(RocksDBHandle.java:114) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.apache.flink.contrib.streaming.state.restore.RocksDBNoneRestoreOperation.restore(RocksDBNoneRestoreOperation.java:62) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	at org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackendBuilder.build(RocksDBKeyedStateBackendBuilder.java:376) ~[flink-dist-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Aug 26 06:55:21 	... 20 more

And another is UT RocksDBResourceContainerTest.testGetColumnFamilyOptionsWithPartitionedIndex

Aug 26 07:39:29 07:39:29.881 [ERROR] Tests run: 11, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.029 s <<< FAILURE! -- in org.apache.flink.contrib.streaming.state.RocksDBResourceContainerTest
Aug 26 07:39:29 07:39:29.881 [ERROR] org.apache.flink.contrib.streaming.state.RocksDBResourceContainerTest.testGetColumnFamilyOptionsWithPartitionedIndex -- Time elapsed: 0.008 s <<< FAILURE!
Aug 26 07:39:29 java.lang.AssertionError: 
Aug 26 07:39:29 
Aug 26 07:39:29 Expected: not <org.rocksdb.BloomFilter@4024001f>
Aug 26 07:39:29      but: was <org.rocksdb.BloomFilter@4024001f>
Aug 26 07:39:29 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
Aug 26 07:39:29 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
Aug 26 07:39:29 	at org.apache.flink.contrib.streaming.state.RocksDBResourceContainerTest.testGetColumnFamilyOptionsWithPartitionedIndex(RocksDBResourceContainerTest.java:320)
Aug 26 07:39:29 	at java.lang.reflect.Method.invoke(Method.java:498)

I'll try to reproduce it on my local machine and figure out how to fix it

@mayuehappy
Copy link
Contributor Author

RocksDBResourceContainerTest.testGetColumnFamilyOptionsWithPartitionedIndex failed because RocksDB-V8.10.0 Overrided the equals() of org.rocksdb.BloomFilter .In RocksDBResourceContainerTest although comparing different objects, this will still return true so the UT to fail.

@mayuehappy
Copy link
Contributor Author

Caused by: org.rocksdb.RocksDBException: `/dev/null' exists but is not a directory

This is because when run e2e test, the directory of rocksdb log will be specified as /dev/null by default. But in Rocksdb-v8.10 will call s = env->CreateDirIfMissing(options.db_log_dir); This will lead the creation of Logger to fail.

@mayuehappy mayuehappy force-pushed the update-frocksdb-jni branch from f7b337d to 2b39c27 Compare August 27, 2024 12:03
@mayuehappy
Copy link
Contributor Author

@flinkbot run azure

@mayuehappy
Copy link
Contributor Author

@Zakelly the CI can pass now , I've two minor changes , please take a look

@@ -296,7 +296,7 @@ function relocate_rocksdb_logs {
# After FLINK-24785, RocksDB's log would be created under Flink's log directory by default,
# this would make e2e tests' artifacts containing too many log files.
# As RocksDB's log would not help much in e2e tests, move the location back to its own folder.
set_config_key "state.backend.rocksdb.log.dir" "/dev/null"
set_config_key "state.backend.rocksdb.log.dir" "/tmp"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little worried that this would lead to many files in "/tmp" and disk space run out in CI machine. Is there any way we disable the log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can set state.backend.rocksdb.log.level to HEADER_LEVEL, in that case RocksDB Log file will be very small

Copy link
Contributor

Choose a reason for hiding this comment

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

But it still creates the log file, right? So /tmp will still accumulate trash log files. How about setting log level to header and keeping them in Flink's log directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it still creates the log file, right? So /tmp will still accumulate trash log files. How about setting log level to header and keeping them in Flink's log directory?

yeah, that's what I mean !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Zakelly I've updated the PR and the CI has passed now, can you take a look

Copy link
Contributor

@Zakelly Zakelly left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the effort!

@Zakelly Zakelly merged commit 576ec2b into apache:master Aug 29, 2024
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.

3 participants