HDDS-10880. Duplicate Pipeline ID Detected in ReconContainerManager.#6742
HDDS-10880. Duplicate Pipeline ID Detected in ReconContainerManager.#6742devmadhuu merged 7 commits intoapache:masterfrom
Conversation
|
@devmadhuu @dombizita |
...op-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconPipelineManager.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconPipelineManager.java
Outdated
Show resolved
Hide resolved
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @ArafatKhan2198 for working on this patch. LGTM +1
|
Skipping addition of pipeline with same Id shall not be the solution. This will mislead the caller that the pipeline is added successfully. |
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineManager.java
Outdated
Show resolved
Hide resolved
|
Thanks for the comment, @raju-balpande . Recon does not work the way you have described. It is not responsible for creating pipeline IDs. SCM (Storage Container Manager) is actually responsible for creating pipelines and their related information along with their UUIDs, which have been thoroughly tested and are robust. SCM will not create a duplicate pipeline ID. If it did, it would affect a lot of other things, not just Recon. Pipelines are created by SCM and then registered in Recon. We have a The addPipeline method in ReconPipelineManager can be called from two entities. The reason for the duplicate pipeline error was that in the ReconContainerManager code, we first check if the pipeline exists. If it does not, we proceed to add it. However, as soon as the existence check passed, the PipelineSyncTask had already added the pipeline, causing the duplicate pipeline error. To address this, we added a final check inside the addPipeline method of ReconPipelineManager. Here, we acquire a write lock, check if the pipeline exists, and then add the pipeline if it does not. This ensures that the exception is not thrown and the appropriate log message is delivered. Recon operates on eventual consistency, meaning it will eventually update and correct itself when state changes. |
Thanks for the clarification, I got the point now. |
|
@ArafatKhan2198 If we always want to check whether pipeline exists before addition, then the check should be performed inside
Benefits:
|
Thanks for the suggestion @adoroszlai ReconContainerManager:
ReconPipelineManager:
ReconPipelineReportHandler:
|
|
Thanks @ArafatKhan2198 for updating the patch.
It's not a big deal, but maybe this one could be changed to make logging conditional: similar to: just in case some other process added the same pipeline in the meantime. |
|
Done with the comments @adoroszlai |
...-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineReportHandler.java
Outdated
Show resolved
Hide resolved
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ArafatKhan2198 for improving the patch.
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @ArafatKhan2198 for improving the patch. Few comments.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconContainerManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineManager.java
Show resolved
Hide resolved
...-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPipelineReportHandler.java
Outdated
Show resolved
Hide resolved
devmadhuu
left a comment
There was a problem hiding this comment.
@ArafatKhan2198 Thanks for improving the patch. Changes LGTM +1.
…pache#6742) Thanks @adoroszlai , @dombizita @raju-balpande for review. Thanks @ArafatKhan2198 for working on this patch.
What changes were proposed in this pull request?
Description:
This pull request proposes changes to handle the scenario where a duplicate pipeline ID is detected in Recon. The modifications ensure that when a pipeline with a duplicate ID is encountered, the system logs a warning and skips the addition, instead of throwing an exception.
Proposed Changes:
addPipelinemethod in theReconPipelineManagerclass to check if the pipeline already exists before attempting to add it.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10880
How was this patch tested?
A new test case was added to
TestReconPipelineManagerto verify that no exception is thrown when a duplicate pipeline is added. The test case involves: