Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11989. Enable SCM Ratis in tests related to DeletedBlockLog #7615

Merged
merged 11 commits into from
Jan 7, 2025

Conversation

chungen0126
Copy link
Contributor

@chungen0126 chungen0126 commented Dec 25, 2024

What changes were proposed in this pull request?

Tests related to DeletedBlockLog needs to be tweaked to work with SCM Ratis enabled:

Error:  Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 225.079 s <<< FAILURE! - in org.apache.hadoop.ozone.container.common.statemachine.commandhandler.TestBlockDeletion
20468Error:  org.apache.hadoop.ozone.container.common.statemachine.commandhandler.TestBlockDeletion.testBlockDeleteCommandParallelProcess  Time elapsed: 45.39 s  <<< ERROR!

Error:  Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 65.86 s <<< FAILURE! - in org.apache.hadoop.ozone.client.rpc.TestDeleteWithInAdequateDN
2897Error:  org.apache.hadoop.ozone.client.rpc.TestDeleteWithInAdequateDN.testDeleteKeyWithInAdequateDN  Time elapsed: 27.673 s  <<< FAILURE!
2898org.opentest4j.AssertionFailedError: Expected org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException to be thrown, but nothing was thrown.
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
	at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
	at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
	at org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3128)
	at org.apache.hadoop.ozone.client.rpc.TestDeleteWithInAdequateDN.testDeleteKeyWithInAdequateDN(TestDeleteWithInAdequateDN.java:314)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

Error:  Tests run: 6, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 108.02 s <<< FAILURE! - in org.apache.hadoop.ozone.container.common.statemachine.commandhandler.TestDeleteContainerHandler
3162Error:  org.apache.hadoop.ozone.container.common.statemachine.commandhandler.TestDeleteContainerHandler.testDeleteContainerRequestHandlerOnClosedContainer  Time elapsed: 16.098 s  <<< ERROR!

What is the link to the Apache JIRA

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

How was this patch tested?

CI:
https://github.com/chungen0126/ozone/actions/runs/12570960386

/**
* Flush deleted block log & wait till something was flushed.
*/
public static void waitForDeletedBlockLog(StorageContainerManager scm)
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope of this PR but I guess this test https://github.com/apache/ozone/blob/master/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java#L324-L334
can be rewritten using the new utility method here.

Can be done as part of HDDS-11867

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

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

PR makes sense. Is it ready for review?

@chungen0126 chungen0126 changed the title HDDS-11989. Enable SCM Ratis in TestBlockDeletion HDDS-11989. Enable SCM Ratis in tests related to DeletedBlockLog Jan 1, 2025
@chungen0126 chungen0126 marked this pull request as ready for review January 1, 2025 15:58
@chungen0126
Copy link
Contributor Author

PR makes sense. Is it ready for review?

Thanks @jojochuang for the review. Marked it as ready for review.

@adoroszlai adoroszlai requested a review from jojochuang January 2, 2025 14:34
return false;
}
}, 1000, 22000);
OzoneTestUtils.waitBlockDeleted(cluster.getStorageContainerManager());
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this isn't an exact replacement because OzoneTestUtils.waitBlockDeleted() doesn't flush SCMHADBTransactionBuffer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This place is for waiting blocks to be deleted. The test flush SCMHADBTransactionBuffer while creating delete transaction log. See

private void addTransactions(StorageContainerManager scm,
DeletedBlockLog delLog,
Map<Long, List<Long>> containerBlocksMap)
throws IOException, TimeoutException {
delLog.addTransactions(containerBlocksMap);
if (SCMHAUtils.isSCMHAEnabled(scm.getConfiguration())) {
scm.getScmHAManager().asSCMHADBTransactionBuffer().flush();
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok

@chungen0126 chungen0126 requested a review from jojochuang January 5, 2025 23:44
Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

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

+1

@jojochuang jojochuang merged commit 8a774a5 into apache:master Jan 7, 2025
29 checks passed
@jojochuang
Copy link
Contributor

Thanks @chungen0126

chungen0126 added a commit to chungen0126/ozone that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants