sodonnel commented on PR #3439: URL: https://github.com/apache/ozone/pull/3439#issuecomment-1134737929
I don't think it is possible to tell on the datanode whether a container is RATIS or STAND_ALONE. The client knows what sort of replication the container should have, and in Ozone, unlike HDFS, the client writes to all 3 DNs in the pipeline. In HDFS DN1 forwards to DN2 etc, so the DNs must know the replication, but in Ozone, this is invisible to the client. Any Ratis magic is handled by the XceiverServerRatis on the DN, and standalone writes goto XceiverServerGRPC. On the Ozone client, it knows the replication type, and will invoke the correct Xceiver on the server. When we come to the CloseContainerCommandHandler, it tries to close a container, and it looks for the pipleine associated with it in ozoneContainer.writeChannel: ``` ozoneContainer.getWriteChannel().isExist(closeCommand.getPipelineID() ``` But the write channel is always the XceiverClientRatis, so when we don't find the ratis pipeline for a standalone container (which we never will), the check fails and the container goes quasi-closed. Aside from some extensive changes on the DN, the only way I can think of to fix this easily, is to add a replicationType field to the closeContainerCommand proto. SCM creates this, and hence must know what sort of container it is - we could easily add replicationType (EC, Standalone, Ratis) to the command and use that in the close handler. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
