-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-12421. ContainerReportHandler should not make the call to delete replicas #7976
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
Changes from 7 commits
8ba9e8d
ff0f98f
ea69cb0
818e889
aa76bc8
f205a6d
647a400
dc9ac6b
1bc4181
e5962e4
f1971c4
08d11c9
65a2876
fb77bae
c26e3df
e854276
a132b80
448a568
c7717d8
a027755
d1f96a5
99a6601
c94aff8
f96df52
849eb62
e710734
b221882
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -352,26 +352,32 @@ private boolean updateContainerState(final DatanodeDetails datanode, | |
| */ | ||
| break; | ||
| case DELETING: | ||
| case DELETED: | ||
| /* | ||
| HDDS-11136: If a DELETING container has a non-empty CLOSED replica, the container should be moved back to CLOSED | ||
| state. | ||
| * HDDS-11136: If a DELETING container has a non-empty CLOSED replica, the container should be moved back to | ||
| * CLOSED state. | ||
| * | ||
| * HDDS-12421: If a DELETED container has a non-empty CLOSED replica, the container should also be moved back to | ||
| * CLOSED state. | ||
| */ | ||
|
|
||
| boolean replicaIsEmpty = replica.hasIsEmpty() && replica.getIsEmpty(); | ||
| // If container is in DELETED state and the reported replica is empty, delete the empty replica. | ||
errose28 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (container.getState() == HddsProtos.LifeCycleState.DELETED && replicaIsEmpty) { | ||
sumitagrawl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| deleteReplica(containerId, datanode, publisher, "DELETED"); | ||
smengcl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ignored = true; | ||
|
||
| break; | ||
| } | ||
|
|
||
| boolean replicaStateAllowed = replica.getState() == State.CLOSED; | ||
errose28 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| boolean replicaNotEmpty = replica.hasIsEmpty() && !replica.getIsEmpty(); | ||
|
Contributor
Author
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. @siddhantsangwan I have a question, do we have cases where Right now,
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. Looks to me like it is ok to omit the existence check for the field, but Siddhant should confirm.
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.
I don't know either.
This behaviour seems fine to me, we shouldn't be deleting replicas if the |
||
| if (replicaStateAllowed && replicaNotEmpty) { | ||
| logger.info("Moving DELETING container {} to CLOSED state, datanode {} reported replica with state={}, " + | ||
| "isEmpty={} and keyCount={}.", containerId, datanode.getHostName(), replica.getState(), false, | ||
| replica.getKeyCount()); | ||
| containerManager.transitionDeletingToClosedState(containerId); | ||
| logger.info("Moving container {} from {} to CLOSED state, datanode {} reported replica with state={}, " + | ||
smengcl marked this conversation as resolved.
Show resolved
Hide resolved
sumitagrawl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "isEmpty={}, bcsId={}, keyCount={}, and origin={}", | ||
| container, container.getState(), datanode.getHostName(), replica.getState(), | ||
| replica.getIsEmpty(), replica.getBlockCommitSequenceId(), replica.getKeyCount(), replica.getOriginNodeId()); | ||
| containerManager.transitionDeletingOrDeletedToClosedState(containerId); | ||
| } | ||
|
|
||
| break; | ||
| case DELETED: | ||
| /* | ||
| * The container is deleted. delete the replica. | ||
| */ | ||
| deleteReplica(containerId, datanode, publisher, "DELETED"); | ||
| ignored = true; | ||
| break; | ||
| default: | ||
| break; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.