-
Notifications
You must be signed in to change notification settings - Fork 600
HDDS-14758. Mismatch in Recon container count between Cluster State and Container Summary #10074
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
Open
devmadhuu
wants to merge
11
commits into
apache:master
Choose a base branch
from
devmadhuu:HDDS-14758
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bbb982c
HDDS-14758. Recon - Mismatch Between Cluster State Container Count an…
31bcdd7
Merge remote-tracking branch 'origin/master' into HDDS-14758
0cd6001
HDDS-14758. PMD Issues Fixed.
9c748d8
HDDS-14758. Findbugs Issues Fixed.
1a45621
HDDS-14758. Test cases failures Fixed.
7b23ef2
HDDS-14758. checkstyle issues Fixed.
d89f224
HDDS-14758. robot tests failures fixed.
c900add
HDDS-14758. Review comments fixed.
8bce456
HDDS-14758. Review comments fixed.
a7817a0
HDDS-14758. pmd issues fixed.
4b411b8
HDDS-14758. CLOSED container sync issues fixed due to incorrect API i…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,7 +239,8 @@ private void initialize() throws IOException { | |
| final ContainerInfo container = iterator.next(); | ||
| Objects.requireNonNull(container, "container == null"); | ||
| containers.addContainer(container); | ||
| if (container.getState() == LifeCycleState.OPEN) { | ||
| if (container.getState() == LifeCycleState.OPEN | ||
| && container.getPipelineID() != null) { | ||
| try { | ||
| pipelineManager.addContainerToPipelineSCMStart( | ||
| container.getPipelineID(), container.containerID()); | ||
|
|
@@ -260,8 +261,12 @@ private void initialize() throws IOException { | |
| getContainerStateChangeActions() { | ||
| final Map<LifeCycleEvent, CheckedConsumer<ContainerInfo, IOException>> | ||
| actions = new EnumMap<>(LifeCycleEvent.class); | ||
| actions.put(FINALIZE, info -> pipelineManager | ||
| .removeContainerFromPipeline(info.getPipelineID(), info.containerID())); | ||
| actions.put(FINALIZE, info -> { | ||
| if (info.getPipelineID() != null) { | ||
| pipelineManager.removeContainerFromPipeline( | ||
| info.getPipelineID(), info.containerID()); | ||
| } | ||
| }); | ||
| return actions; | ||
| } | ||
|
|
||
|
|
@@ -334,12 +339,16 @@ public void addContainer(final ContainerInfoProto containerInfo) | |
| transactionBuffer.addToBuffer(containerStore, | ||
| containerID, container); | ||
| containers.addContainer(container); | ||
| if (pipelineManager.containsPipeline(pipelineID)) { | ||
| if (pipelineID != null && pipelineManager.containsPipeline(pipelineID)) { | ||
| pipelineManager.addContainerToPipeline(pipelineID, containerID); | ||
| } else if (containerInfo.getState(). | ||
| equals(LifeCycleState.OPEN)) { | ||
| // Pipeline should exist, but not | ||
| throw new PipelineNotFoundException(); | ||
| if (pipelineID != null) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Null pipelineId also represent PipelineNotFound Exception |
||
| // OPEN containers normally require a live pipeline reference. | ||
| throw new PipelineNotFoundException(); | ||
| } | ||
| LOG.warn("Adding OPEN container {} without pipeline tracking " | ||
| + "because its pipeline ID is null.", containerID); | ||
| } | ||
| //recon may receive report of closed container, | ||
| // no corresponding Pipeline can be synced for scm. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -415,8 +415,21 @@ public List<ContainerWithPipeline> getExistContainerWithPipelinesInBatch( | |
| ContainerWithPipeline cp = getContainerWithPipelineCommon(containerID); | ||
| cpList.add(cp); | ||
| } catch (IOException ex) { | ||
| //not found , just go ahead | ||
| LOG.error("Container with common pipeline not found: {}", ex); | ||
| // Pipeline lookup failed (e.g., QUASI_CLOSED container whose pipeline | ||
| // has already been cleaned up). Return the container metadata without a | ||
| // pipeline so that callers (e.g., Recon's sync) can still record the | ||
| // container rather than losing it silently. | ||
| LOG.warn("Pipeline lookup failed for container {}; returning container " | ||
| + "without pipeline. Cause: {}", containerID, ex.getMessage()); | ||
| try { | ||
| ContainerInfo info = scm.getContainerManager() | ||
| .getContainer(ContainerID.valueOf(containerID)); | ||
| cpList.add(new ContainerWithPipeline(info, null)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we returning pipeline as null here ? |
||
| } catch (ContainerNotFoundException notFound) { | ||
| // Container truly does not exist in SCM — exclude it from the result. | ||
| LOG.error("Container {} not found in SCM and will not be returned " | ||
| + "to caller.", containerID, notFound); | ||
| } | ||
| } | ||
| } | ||
| return cpList; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reason for adding this check? Do possible that container open is reported but pipeline does not exist (closed due to some error), can have some impact with the check