HDDS-6760. [SCM HA finalization] Support for happy path finalization - #3465
Conversation
…zation checkpoint
* master: (96 commits) HDDS-6738. Migrate tests with rules in hdds-server-framework to JUnit5 (apache#3415) HDDS-6650. S3MultipartUpload support update bucket usedNamespace. (apache#3404) HDDS-6491. Support FSO keys in getExpiredOpenKeys (apache#3226) HDDS-6596. EC: Support ListBlock from CoordinatorDN (apache#3410) HDDS-6737. Migrate parameterized tests in hdds-server-framework to JUnit5 (apache#3414) HDDS-6660: EC: Add the DN side Reconstruction Handler class. (apache#3399) HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5 (apache#3417) HDDS-6749. SCM includes itself as peer in addSCM request (apache#3413) HDDS-6657. Improve Ozone integrated Ranger configuration instructions (apache#3365) HDDS-6742. Audit operation category mismatch (apache#3407) HDDS-6748. Intermittent timeout in TestECBlockReconstructedInputStream#testReadDataWithUnbuffer (apache#3416) HDDS-6731. Migrate simple tests in hdds-server-framework to JUnit5 (apache#3412) HDDS-5919. In kubernetes OM HA has circular dependency on service availability (apache#3185) HDDS-6730. Migrate tests in hdds-tools to JUnit5 (apache#3402) HDDS-6630. Explicitly remove node after being chosen (apache#3332) HDDS-6560. Add general Grafana dashboard (apache#3285) HDDS-6704. EC: ReplicationManager - create version of ContainerReplicaCounts applicable to EC (apache#3405) HDDS-6680. Pre-Finalize behaviour for Bucket Layout Feature. (apache#3377) HDDS-6619. Add freon command to run r/w mix workload using ObjectStore APIs (apache#3383) HDDS-6734. ozone admin pipeline list CLI is not backward compatible (apache#3406) ... Conflicts: hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMMetadataStore.java hadoop-hdds/interface-server/src/main/proto/SCMRatisProtocol.proto hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMDBDefinition.java hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMMetadataStoreImpl.java hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java
Still need to test resuming finalization from a checkpoint.
* master: HDDS-6756. NPE raised by RpcClient if ServiceInfo certificates empty (apache#3428) HDDS-6786. Bad value for metric NumBytesCommittedCount in testContainerStateMachineMetrics (apache#3443) HDDS-6778. Bump Guava to 31.1 (apache#3435) HDDS-6784. Missing close() for two RocksDB table iterators (apache#3440) HDDS-6779. Register metricSink after initialization in S3 Gateway (apache#3436) HDDS-6787. Bump gson to 2.8.9 (apache#3441) HDDS-6777. Upgrade JUnit 5 to 5.8.2 (apache#3437) HDDS-6097. Upgrade to Ratis 2.3.0, gRPC 1.44.0, Netty 4.1.74 (apache#3433) HDDS-6744. EC: ReplicationManager - create ContainerReplicaPendingOps class and integrate with ContainerManager (apache#3425)
… not run Fixes test failure in TestDatanodeUpgradeToScmHA.
Resolves failure in TestScmFinalization unit test.
- Clarify log messages - Add comments - Switch new unit test to jupiter for parameterization.
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @errose28 for the huge amount of work put into this patch. Noticed a possible class mismatch (typo), otherwise LGTM.
|
Thanks for taking the time to review this large feature @adoroszlai! I have addressed both comments in the most recent commit. |
|
@errose28 Thanks for updating the patch. Looks like upgrade acceptance test failed at Three datanodes keep repeating: |
- Removes circular dependency between FianlizationStateManager and NodeManager. - Fixes deadlock bug.
Should fix the issue with containers being stuck in the CLOSING state.
* master: (87 commits) HDDS-6686. Do Leadship check before SASL token verification. (apache#3382) HDDS-4364: [FSO]List FileStatus : startKey can be a non-existed path (apache#3481) HDDS-6091. Add file checksum to OmKeyInfo (apache#3201) HDDS-6706. Exposing Volume Information Metrics to the DataNode UI (apache#3478) HDDS-6759: Add listblock API in MockDatanodeStorage (apache#3452) HDDS-5821 Container cache management for closing RockDB (apache#3426) HDDS-6683. Refactor OM server bucket layout configuration usage (apache#3477) HDDS-6824. Revert changes made in proto.lock by HDDS-6768. (apache#3480) HDDS-6811. Bucket create message with layout type (apache#3479) HDDS-6810. Add a optional flag to trigger listStatus as part of listKeys for FSO buckets. (apache#3461) HDDS-6828. Revert RockDB version pending leak fixes (apache#3475) HDDS-6764: EC: DN ability to create RECOVERING containers for EC reconstruction. (apache#3458) HDDS-6795: EC: PipelineStateMap#addPipeline should not have precondition checks post db updates (apache#3453) HDDS-6823. Intermittent failure in TestOzoneECClient#testExcludeOnDNMixed (apache#3476) HDDS-6820. Bucket Layout Post-Finalization Validators for ACL Requests. (apache#3472) HDDS-6819. Add LEGACY to AllowedBucketLayouts in CreateBucketHandler (apache#3473) HDDS-4859. [FSO]ListKeys: seek all the files/dirs from startKey to keyPrefix (apache#3466) HDDS-6705 Add metrics for volume statistics including disk capacity, usage, Reserved (apache#3430) HDDS-6474. Add test to cover the FSO bucket list status with beyond batch boundary and cache. (apache#3379). Contributed by aswinshakil HDDS-6280. Support Container Balancer HA (apache#3423) ...
|
Hi @adoroszlai I have updated the PR. The issue with containers stuck in the CLOSING state should be fixed, see the explanation added to the docker-config file comments. I have also changed the PR so that the finalization checkpoint is written to the I will be doing repeated runs of the upgrade acceptance test overnight here to test stability, but PTAL in the meantime. |
|
@errose28, thanks for working on this PR. |
* master: HDDS-6751. Migrate parameterized tests in hdds-server-scm to JUnit5 (apache#3431)
|
Although the tests were passing pretty consistently with the last set of changes and a bit longer test timeout, I have made some minor changes that I think will improve the test execution and finalization in a live cluster overall. The case we are working with is when finalization is run soon after SCM exits safemode and the datanodes have not yet finished leader elections for their pipelines. In this case, the close commands sent by SCM may result in all 3 container replicas entering the CLOSING state but no datanode actually submitting the close command through Ratis. The datanodes will not finalize when containers are in the CLOSING state. In the original SCM finalization implementation, the Set<PipelineID> pipelineIDs = nodeManager.getPipelines(datanodeDetails);
for (PipelineID id: pipelineIDs) {
LOG.info("Closing pipeline {} which uses HEALTHY READONLY datanode {} ",
id, datanodeDetails);
try {
pipelineManager.closePipeline(pipelineManager.getPipeline(id), false);
} catch (IOException ex) {
LOG.error("Failed to close pipeline {} which uses HEALTHY READONLY " +
"datanode {}: ", id, datanodeDetails, ex);
}
}Since pipelines were closed normally (not force closed) when finalization started, this would force close the already closed pipelines, moving the CLOSING containers to QUASI_CLOSED and allowing finalization to pass. In earlier versions of this patch, I changed this block: Set<PipelineID> pipelineIDs = nodeManager.getPipelines(datanodeDetails);
for (PipelineID id: pipelineIDs) {
try {
Pipeline pipeline = pipelineManager.getPipeline(id);
if (pipeline.getPipelineState() != Pipeline.PipelineState.CLOSED) {
LOG.warn("Closing pipeline {} which uses HEALTHY READONLY datanode " +
"{}.", id, datanodeDetails.getUuidString());
pipelineManager.closePipeline(pipeline, true);
}
} catch (IOException ex) {
LOG.error("Failed to close pipeline {} which uses HEALTHY READONLY " +
"datanode {}: ", id, datanodeDetails, ex);
}
}Since the pipelines were already closed during finalization, the pipeline close here became a no-op, and the CLOSING containers lingered on the datanodes. I originally handled this in the test by making the ReplicationManager run soon after SCM exited safemode to move the containers from CLOSING to CLOSED, but this was still slow to finish, both in the test and possibly in a real cluster as well. In the most recent update, I have changed the block to this: Set<PipelineID> pipelineIDs = nodeManager.getPipelines(datanodeDetails);
for (PipelineID pipelineID : pipelineIDs) {
try {
Pipeline pipeline = pipelineManager.getPipeline(pipelineID);
LOG.info("Sending close command for pipeline {} in state {} which " +
"uses {} datanode {}. This will send close commands for its " +
"containers.",
pipelineID, pipeline.getPipelineState(),
HddsProtos.NodeState.HEALTHY_READONLY,
datanodeDetails.getUuidString());
pipelineManager.closePipeline(pipeline, true);
} catch (IOException ex) {
LOG.error("Failed to close pipeline {} which uses HEALTHY READONLY " +
"datanode {}: ", pipelineID, datanodeDetails, ex);
}
}Now when a healthy readonly datanode heartbeats back to SCM, the close pipeline command will queue close container commands for all containers in the pipeline. For already CLOSED containers this will be a no-op, but for CLOSING containers whose datanodes have since finished their pipeline leader election, this will move them to CLOSED without needing to wait for the ReplicationManager to start. This should allow finalization to proceed at the same pace as before, but without the occasional quasi closed containers and without test specific config changes for the replication manager. I will again be doing repeated testing of the acceptance test on my fork, and will update here when it appears stable. |
swagle
left a comment
There was a problem hiding this comment.
+1 LGTM, @nandakumar131 can you also take a quick look please!
|
@errose28, thanks for working on this. |
What changes were proposed in this pull request?
Please read the design document attached to HDDS-5141 for context when reviewing
Add the foundation for finalizing an SCM HA cluster. Non-HA SCM finalization will also use this code from now on. Other remaining items under the parent Jira HDDS-5141 which are out of scope for this task are:
Portions of the common upgrade framework were refactored under this PR as well to make it more flexible for supporting SCM HA finalization. For example, finalization in the
BasicUpgradeFinalizerwas split from one method finalizing all layout features to one method invoked to finalize each layout feature.Some more invasive changes are marked as TODO to reduce the size of this PR:
-
Refactor the oldNo longer relevant with the current changes.SCMNodeManagerconstructor which has been left due to its high usage in tests.- Refactor
TestSCMNodeManagerto use junit jupiter for test specific parameterization.What is the link to the Apache JIRA
HDDS-6760
How was this patch tested?
TestHDDSUpgrade#testFinalizationFromInitialVersionToLatestVersionwas run with 3 SCMs and passed consistently, although this test is excluded from the regular CI workflow.