Skip to content

HDDS-8120. [Snapshot] Close rocksDB connection after SstFilteringTask finishes - #4366

Merged
prashantpogde merged 1 commit into
apache:masterfrom
DaveTeng0:HDDS-8120
Mar 9, 2023
Merged

HDDS-8120. [Snapshot] Close rocksDB connection after SstFilteringTask finishes#4366
prashantpogde merged 1 commit into
apache:masterfrom
DaveTeng0:HDDS-8120

Conversation

@DaveTeng0

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Close rocksDB connection after SstFilteringTask finishes.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-8120

How was this patch tested?

Tested in dev cluster.

@aswinshakilaswinshakil added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Mar 8, 2023
@aswinshakilaswinshakil changed the title HDDS-8120 Close rocksDB connection after SstFilteringTask finishesHDDS-8120. [Snapshot] Close rocksDB connection after SstFilteringTask finishesMar 8, 2023
@prashantpogde

Copy link
Copy Markdown
Contributor

Since we are opening snapshot rocksDB instance in RW mode, we need to make sure that auto-compaction is turned off. I have filed https://issues.apache.org/jira/browse/HDDS-8122 to track this.

@prashantpogde

Copy link
Copy Markdown
Contributor

thank you @DaveTeng0 for thsi patch.

@prashantpogde
prashantpogde merged commit 9fa04a8 into apache:masterMar 9, 2023
@adoroszlai

Copy link
Copy Markdown
Contributor

Please pay attention when merging PRs. If it has a single commit, GitHub uses the commit's message by default, not the PR title.

Author: DaveTeng0 <109315747+DaveTeng0@users.noreply.github.com>
AuthorDate: Thu Mar 9 11:28:26 2023 -0800
Commit: GitHub <noreply@github.com>
CommitDate: Thu Mar 9 11:28:26 2023 -0800
close db connection (#4366)

dbName, true);
RocksDatabase db = rdbStore.getDb();
db.deleteFilesNotMatchingPrefix(prefixPairs, filterFunction);
rdbStore.close();

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.

Use try-with-resources to ensure close happens even in face of exceptions.

try (RDBStorerdbStore = (RDBStore) OmMetadataManagerImpl
.loadDB(ozoneManager.getConfiguration(), newFile(snapshotDir),
dbName, true)) {
RocksDatabasedb = rdbStore.getDb();
db.deleteFilesNotMatchingPrefix(prefixPairs, filterFunction);
}

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.

Good catch. @DaveTeng0 Would you post another PR to address this?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

good catch! yeah i'll do that!

errose28 added a commit to errose28/ozone that referenced this pull request Mar 16, 2023
* master: (262 commits)
HDDS-8153. Integrate ContainerBalancer with MoveManager (apache#4391)
HDDS-8090. When getBlock from a datanode fails, retry other datanodes. (apache#4357)
HDDS-8163 Use try-with-resources to ensure close rockdb connection in SstFilteringService (apache#4402)
HDDS-8065. Provide GNU long options (apache#4394)
HDDS-7930. [addendum] input stream does not refresh expired block token.
HDDS-7930. input stream does not refresh expired block token. (apache#4378)
HDDS-7740. [Snapshot] Implement SnapshotDeletingService (apache#4244)
HDDS-8076. Use container cache in Key listing API. (apache#4346)
HDDS-8091. [addendum] Generate list of config tags from ConfigTag enum - Hadoop 3.1 compatibility fix (apache#4374)
HDDS-8144. TestDefaultCertificateClient#testTimeBeforeExpiryGracePeriod fails as we approach DST. (apache#4382)
HDDS-8151. Support fine grained lifetime for root CA certificate (apache#4386)
HDDS-8150. RpcClientTest and ConfigurationSourceTest not run due to naming convention (apache#4388)
HDDS-8131. Add Configuration for OM Ratis Log Purge Tuning Parameters. (apache#4371)
HDDS-8133. Create ozone sh key checksum command (apache#4375)
HDDS-8142. Check if no entries in Block DB for a container on container delete (apache#4379)
HDDS-8118. Fail container delete on non empty chunks dir (apache#4367)
HDDS-8028. JNI for RocksDB SST Dump tool (apache#4315)
HDDS-8129. ContainerStateMachine allows two different tasks with the same container id running in parallel. (apache#4370)
HDDS-8119. Remove loosely related AutoCloseable from SendContainerOutputStream (apache#4368)
close db connection (apache#4366)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshothttps://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@DaveTeng0@prashantpogde@adoroszlai@sadanand48@smengcl@aswinshakil