Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,7 @@ private void markBlocksForDeletionTransaction(
int newDeletionBlocks, long txnID, DeletionMarker marker)
throws IOException {
long containerId = delTX.getContainerID();
if (!isTxnIdValid(containerId, containerData, delTX)) {
return;
}
logDeleteTransaction(containerId, containerData, delTX);
try (DBHandle containerDB = BlockUtils.getDB(containerData, conf)) {
DeleteTransactionStore<?> store =
(DeleteTransactionStore<?>) containerDB.getStore();
Expand All @@ -391,9 +389,7 @@ private void markBlocksForDeletionSchemaV1(
KeyValueContainerData containerData, DeletedBlocksTransaction delTX)
throws IOException {
long containerId = delTX.getContainerID();
if (!isTxnIdValid(containerId, containerData, delTX)) {
return;
}
logDeleteTransaction(containerId, containerData, delTX);
int newDeletionBlocks = 0;
try (DBHandle containerDB = BlockUtils.getDB(containerData, conf)) {
Table<String, BlockData> blockDataTable =
Expand Down Expand Up @@ -482,23 +478,19 @@ private void updateMetaData(KeyValueContainerData containerData,
}
}

private boolean isTxnIdValid(long containerId,
private void logDeleteTransaction(long containerId,
KeyValueContainerData containerData, DeletedBlocksTransaction delTX) {
boolean b = true;
if (LOG.isDebugEnabled()) {
LOG.debug("Processing Container : {}, DB path : {}", containerId,
containerData.getMetadataPath());
LOG.debug("Processing Container : {}, DB path : {}, transaction {}",
containerId, containerData.getMetadataPath(), delTX.getTxID());
}

if (delTX.getTxID() <= containerData.getDeleteTransactionId()) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Ignoring delete blocks for containerId: %d."
+ " Outdated delete transactionId %d < %d", containerId,
delTX.getTxID(), containerData.getDeleteTransactionId()));
}
b = false;
LOG.info(String.format("Delete blocks for containerId: %d"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a metric for this. It is a lot quicker to scan across a cluster.

Copy link
Contributor Author

@sumitagrawl sumitagrawl Mar 14, 2023

Choose a reason for hiding this comment

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

@kerneltime This metrics will not have value, its just retry which will not happen frequently, and no impact to system.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can add it as a part of a separate Jira, but a count of how many times this occurred is interesting.

+ " is either received out of order or retried,"
+ " %d <= %d", containerId, delTX.getTxID(),
containerData.getDeleteTransactionId()));
}
return b;
}

@Override
Expand Down