Skip to content
Merged
Show file tree
Hide file tree
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 @@ -237,10 +237,12 @@ public int getBlockDeleteTXNum() {
public void notifyStatusChanged() {
serviceLock.lock();
try {
if (scmContext.isLeaderReady() && !scmContext.isInSafeMode() &&
serviceStatus != ServiceStatus.RUNNING) {
safemodeExitMillis = clock.millis();
serviceStatus = ServiceStatus.RUNNING;
if (scmContext.isLeaderReady() && !scmContext.isInSafeMode()) {
if (serviceStatus != ServiceStatus.RUNNING) {
LOG.info("notifyStatusChanged" + ":" + ServiceStatus.RUNNING);
safemodeExitMillis = clock.millis();
serviceStatus = ServiceStatus.RUNNING;
}
} else {
serviceStatus = ServiceStatus.PAUSING;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public void init() throws Exception {
0,
TimeUnit.MILLISECONDS);
conf.setInt("hdds.datanode.block.delete.threads.max", 5);
conf.setInt("hdds.datanode.block.delete.queue.limit", 32);
ReplicationManager.ReplicationManagerConfiguration replicationConf = conf
.getObject(ReplicationManager.ReplicationManagerConfiguration.class);
replicationConf.setInterval(Duration.ofSeconds(300));
Expand Down Expand Up @@ -293,11 +294,6 @@ public void testBlockDeletion(ReplicationConfig repConfig) throws Exception {
Assertions.assertFalse(containerIdsWithDeletedBlocks.isEmpty());
// Containers in the DN and SCM should have same delete transactionIds
matchContainerTransactionIds();
// Containers in the DN and SCM should have same delete transactionIds
// after DN restart. The assertion is just to verify that the state of
// containerInfos in dn and scm is consistent after dn restart.
cluster.restartHddsDatanode(0, true);
matchContainerTransactionIds();

// Verify transactions committed
GenericTestUtils.waitFor(() -> {
Expand All @@ -309,6 +305,13 @@ public void testBlockDeletion(ReplicationConfig repConfig) throws Exception {
return false;
}
}, 500, 10000);

// Containers in the DN and SCM should have same delete transactionIds
// after DN restart. The assertion is just to verify that the state of
// containerInfos in dn and scm is consistent after dn restart.
cluster.restartHddsDatanode(0, true);
matchContainerTransactionIds();

Assertions.assertEquals(metrics.getNumBlockDeletionTransactionCreated(),
metrics.getNumBlockDeletionTransactionCompleted());
Assertions.assertTrue(metrics.getNumBlockDeletionCommandSent() >=
Expand Down