[
https://issues.apache.org/jira/browse/HDDS-17845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18150181#comment-18150181
]
Rui Wang edited comment on HDDS-17845 at 11/24/26, 8:25 AM:
------------------------------------------------------------
[~szetszwo] thanks for the patch and also compare the two approaches by a table.
IIUC the primary problem we want to solve is to decide the ContainerSM and
pipeline's replication type upon DN restarts.
Before we move forward to review the patch, can we still have some time to
discuss the third approach: persistent the replication type as a part of the
RaftGroup in Ratis?
The idea is when RaftGroup reloads from the storage, it can discover the
information. This will require Ratis change, likely a Map<string, string>
metadata associated with the RaftGroup and ser/deser in disk. This idea is
close to the second approach in the JIRA but about a different way to persist
the information on DNs.
AI summarise the benefits better than me :
{panel:title=Why Ratis design is better}
* One lifecycle. The type would be written when the group is created and
removed with the group's directory. That drops the startup cleanup in
cleanupPipelineCreateInfoTable(), the delete in removeGroup, and both
stale-entry problems from my review.
* No crash window. If Ratis writes the metadata while it formats the group, a
group can never exist on disk without its type. The PR has to use a
write-first, clean-up-later ordering to get close to that.
* Same disk as the group. If the Ratis disk fails, the group and its type are
lost together. A stale table entry, or a group silently reloaded as RATIS,
can't happen.
* CHAINED can be added from a peer. The type travels in the add-group request.
That removes the limitation noted in CreatePipelineCommandHandler ("For
CHAINED, fan-out not working"), which neither the PR nor SCM reply solves.
* The type stays final. It's known before the state machine is built, so
ContainerStateMachine keeps the property the PR author cared about.
* No datanode RocksDB schema change. Nothing needs to be added to the witnessed
DB or kept compatible afterwards.
{panel}
was (Author: amaliujia):
[~szetszwo] thanks for the patch and also compare the two approaches by a table.
IIUC the primary problem we want to solve is to decide the ContainerSM and
pipeline's replication type upon DN restarts.
Before we move forward to review the patch, can we still have some time to
discuss the third approach: persistent the replication type as a part of the
RaftGroup in Ratis?
The idea is when RaftGroup reloads from the storage, it can discover the
information. This will require Ratis change, likely a Map<string, string>
metadata associated with the RaftGroup and ser/deser in disk.
AI summarise the benefits better than me :
{panel:title=Why Ratis design is better}
* One lifecycle. The type would be written when the group is created and
removed with the group's directory. That drops the startup cleanup in
cleanupPipelineCreateInfoTable(), the delete in removeGroup, and both
stale-entry problems from my review.
* No crash window. If Ratis writes the metadata while it formats the group, a
group can never exist on disk without its type. The PR has to use a
write-first, clean-up-later ordering to get close to that.
* Same disk as the group. If the Ratis disk fails, the group and its type are
lost together. A stale table entry, or a group silently reloaded as RATIS,
can't happen.
* CHAINED can be added from a peer. The type travels in the add-group request.
That removes the limitation noted in CreatePipelineCommandHandler ("For
CHAINED, fan-out not working"), which neither the PR nor SCM reply solves.
* The type stays final. It's known before the state machine is built, so
ContainerStateMachine keeps the property the PR author cared about.
* No datanode RocksDB schema change. Nothing needs to be added to the witnessed
DB or kept compatible afterwards.
{panel}
> Restore ReplicationType in ContainerStateMachine when a datanode restart
> ------------------------------------------------------------------------
>
> Key: HDDS-17845
> URL: https://issues.apache.org/jira/browse/HDDS-17845
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: Ozone Datanode
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
> Labels: pull-request-available
>
> (Assisted by Claude)
> When a datanode restart, we need some way to tell the ReplicationType of an
> open container in order to recreate the ContainerStateMachine. Two approaches
> below are considered, SCM reply vs Per-pipeline RocksDB marker:
> || ||SCM reply||Per-pipeline RocksDB marker||
> |On-disk change|none|new column family in the witnessed DB|
> |Protocol change|PipelineReport field and handling|none|
> |Unknown window after restart|~registration + 1 heartbeat, behaving
> permissively|none: known before log replay|
> |Source of truth|SCM, so it can't go stale|the datanode, so a crash between
> steps can leave a stray marker|
> |State machine type|mutable, set once|final, and the subclass split stays
> possible|
> Although SCM reply does not requires on-disk change, there are may edge cases
> listed below. Therefore, we will implement Per-pipeline RocksDB marker
> - SCM doesn't know the pipeline: the existing ClosePipelineCommand path
> removes the group, so the type never matters.
> - Datanode was stale or dead: SCM has already closed the pipeline, which is
> the self-healing path from before.
> - Old SCM, new datanode: the old SCM ignores the flag, so the type stays
> unknown and the datanode keeps allowing both kinds. Safe, just without the
> checks.
> - New SCM, old datanode: an old datanode never sets the flag, so nothing
> changes for it.
> - SCM unreachable or not leader: the type stays unknown until the leader
> answers.
> Regarding to HDDSVersion, see Note 1 in the first comment.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]