Skip to content

Commit

Permalink
HDDS-9986. Log if there is a failure in closing RocksDB
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantk-12 authored Dec 22, 2023
1 parent 0008d9a commit 4cda788
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ public void close() throws IOException {
}

RDBMetrics.unRegister();
IOUtils.closeQuietly(checkPointManager);
IOUtils.close(LOG, checkPointManager);
if (rocksDBCheckpointDiffer != null) {
RocksDBCheckpointDifferHolder
.invalidateCacheEntry(rocksDBCheckpointDiffer.getMetadataDir());
}
IOUtils.closeQuietly(db);
IOUtils.close(LOG, db);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public ReferenceCounted<IOmMetadataReader, SnapshotCache> get(String key,
// does not exist, and increment the reference count on the instance.
ReferenceCounted<IOmMetadataReader, SnapshotCache> rcOmSnapshot =
dbMap.compute(key, (k, v) -> {
LOG.info("Loading snapshot. Table key: {}", k);
if (v == null) {
LOG.info("Loading snapshot. Table key: {}", k);
try {
v = new ReferenceCounted<>(cacheLoader.load(k), false, this);
} catch (OMException omEx) {
Expand Down Expand Up @@ -317,7 +317,7 @@ private void cleanupInternal() {
Preconditions.checkState(rcOmSnapshot == result,
"Cache map entry removal failure. The cache is in an inconsistent "
+ "state. Expected OmSnapshot instance: " + rcOmSnapshot
+ ", actual: " + result);
+ ", actual: " + result + " for key: " + key);

pendingEvictionList.remove(result);

Expand Down

0 comments on commit 4cda788

Please sign in to comment.