-
Notifications
You must be signed in to change notification settings - Fork 496
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
HDDS-3244. Improve write efficiency by opening RocksDB only once #709
Conversation
@bharatviswa504 Could you help review this patch ? If you agree with the change, I will fix the CI failure. Thank you very much. |
.../src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java
Show resolved
Hide resolved
b55237d
to
a145399
Compare
@bharatviswa504 Could you help review it again. |
ReferenceCountedDB db = | ||
new ReferenceCountedDB(store, dbFile.getAbsolutePath()); | ||
//add db handler into cache | ||
BlockUtils.addDB(db, dbFile.getAbsolutePath(), conf); |
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.
I think its better to update the cache only at the end of function "createContainerMetaData" so that even if the chunk dir creation fails, it won't be added to the container cache.
What changes were proposed in this pull request?
What's the problem ?
created in
HddsDispatcher.WriteChunk
, but then the created RocksDB was closed, untilHddsDispatcher.PutBlock
the RocsDB will be opend again and then put it into cache, so the RocksDB was open twice in each datanode. Becase RocksDB.open cost about 200ms, so open it twice is a waste.How to fix it ?
HddsDispatcher.PutBlock
.What is the link to the Apache JIRA
https://issues.apache.org/jira/projects/HDDS/issues/HDDS-3244
How was this patch tested?
Existed UT and IT.