Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ce17803
HDDS-8882. Add state management of SCM's DeleteBlocksCommand to avoid…
xichen01 Jun 27, 2023
d596899
added licensed for new file
xichen01 Jun 28, 2023
2807f2a
Add unit test
xichen01 Jun 29, 2023
a94d6cb
Fix integration test
xichen01 Jun 29, 2023
2021a3b
Fix findbugs
xichen01 Jun 30, 2023
e4d2e21
Merge branch 'master' into HDDS-8882
xichen01 Jun 30, 2023
1ba8e08
Add integration test
xichen01 Jun 30, 2023
a1117a2
Fix test
xichen01 Jun 30, 2023
0bf4545
Fix test
xichen01 Jun 30, 2023
5f51a92
Fix test
xichen01 Jul 1, 2023
d10b30c
Merge branch 'apache:master' into HDDS-8882
xichen01 Jul 3, 2023
b7a9c1c
Add status cleanup when datanode is dead
xichen01 Jul 13, 2023
391dca9
Merge transactionToDNsCommitMap to SCMDeleteBlocksCommandStatusManager
xichen01 Jul 15, 2023
5592902
Merge branch 'HDDS-8882' of github.com:xichen01/ozone into HDDS-8882
xichen01 Jul 15, 2023
f792ccc
Split TestSCMDeleteBlocksCommandStatusManager and TestSCMDeleteBlocks…
xichen01 Jul 16, 2023
be5e118
Implement NodeManager#registerSendCommandNotify
xichen01 Jul 16, 2023
5fc9b5c
Fix test
xichen01 Jul 17, 2023
24e0e5a
Fix test
xichen01 Jul 17, 2023
43c7251
fix checkstyle
xichen01 Jul 17, 2023
bb55189
Simplified State of SCMDeleteBlocksCommandStatusManager
xichen01 Oct 8, 2023
553b702
Merge branch 'master' into HDDS-8882
xichen01 Nov 6, 2023
d353c08
move transactionToRetryCountMap into SCMDeletedBlockGTransactionStatu…
xichen01 Nov 6, 2023
d859264
Merge recordTransactionCreated and recordTransactionCommitted; Remove…
xichen01 Dec 1, 2023
addbdf5
Add additional processing logic in the updateStatus
xichen01 Dec 1, 2023
3424aec
Merge branch 'master' into HDDS-8882
xichen01 Dec 1, 2023
343b67d
Fix test
xichen01 Dec 2, 2023
03cca5f
Findbugs
xichen01 Dec 2, 2023
0a39cb3
Remove getSCMDeletedBlockTransactionStatusManager from DeletedBlockLog
xichen01 Dec 9, 2023
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 @@ -78,9 +78,9 @@ protected CommandStatusReportsProto getReport() {
// If status is still pending then don't remove it from map as
// CommandHandler will change its status when it works on this command.
if (!cmdStatus.getStatus().equals(Status.PENDING)) {
builder.addCmdStatus(cmdStatus.getProtoBufMessage());
map.remove(key);
}
builder.addCmdStatus(cmdStatus.getProtoBufMessage());
});
return builder.getCmdStatusCount() > 0 ? builder.build() : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public void testCommandStatusPublisher() throws InterruptedException {
.build();
cmdStatusMap.put(obj1.getCmdId(), obj1);
cmdStatusMap.put(obj2.getCmdId(), obj2);
// We are not sending the commands whose status is PENDING.
Assertions.assertEquals(1,
// We will sending the commands whose status is PENDING and EXECUTED
Assertions.assertEquals(2,
((CommandStatusReportPublisher) publisher).getReport()
.getCmdStatusCount(),
"Should publish report with 2 status objects");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@

import java.util.Set;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerDatanodeProtocolProtos.ContainerBlocksDeletionACKProto
.DeleteBlockTransactionResult;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerDatanodeProtocolProtos.DeletedBlocksTransaction;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;

import java.io.Closeable;
import java.io.IOException;
Expand Down Expand Up @@ -88,14 +86,33 @@ void incrementCount(List<Long> txIDs)
int resetCount(List<Long> txIDs) throws IOException;

/**
* Commits a transaction means to delete all footprints of a transaction
* from the log. This method doesn't guarantee all transactions can be
* successfully deleted, it tolerate failures and tries best efforts to.
* @param transactionResults - delete block transaction results.
* @param dnID - ID of datanode which acknowledges the delete block command.
* Records the creation of a transaction for a DataNode.
*
* @param dnId The identifier of the DataNode.
* @param scmCmdId The ID of the SCM command.
* @param dnTxSet Set of transaction IDs for the DataNode.
*/
void recordTransactionCreated(
UUID dnId, long scmCmdId, Set<Long> dnTxSet);

/**
* Handles the cleanup process when a DataNode is reported dead. This method
* is responsible for updating or cleaning up the transaction records
* associated with the dead DataNode.
*
* @param dnId The identifier of the dead DataNode.
*/
void onDatanodeDead(UUID dnId);

/**
* Records the event of sending a block deletion command to a DataNode. This
* method is called when a command is successfully dispatched to a DataNode,
* and it helps in tracking the status of the command.
*
* @param dnId Details of the DataNode.
* @param scmCommand The block deletion command sent.
*/
void commitTransactions(List<DeleteBlockTransactionResult> transactionResults,
UUID dnID);
void onSent(DatanodeDetails dnId, SCMCommand<?> scmCommand);

/**
* Creates block deletion transactions for a set of containers,
Expand Down
Loading