[ 
https://issues.apache.org/jira/browse/HDDS-9544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786351#comment-17786351
 ] 

Nandakumar commented on HDDS-9544:
----------------------------------

bq. Looks like it randomly generates the pipelineID on every request, which 
should not be the case.
This is expected behavior.
 
A container is part of only one Pipeline at any point of time. When the 
container is in {{OPEN/CLOSING}} state they are managed by Ratis Pipeline.
Once the container is {{CLOSED/QUASI_CLOSED}}, they are managed using Simple 
Pipeline.

Simple Pipelines are kinda ephemeral, they are easy to create and are 
stateless. Simple Pipeline informations are not stored.
 
Whenever a client requests for the Pipeline of {{CLOSED/QUASI_CLOSED}} 
Container, Simple Pipeline is created on the fly and handed over to the client, 
so the PipelineID is randomly generated. This causes the PipelineID to change 
everytime.
 
One improvement that we can do is to try and generate the same PipelineID 
everytime (for the same set of Datanodes) using {{UUID.nameUUIDFromBytes}} API. 
By doing this we will be generating the same PipelineID for every call for same 
set of Datanodes.

> Incorrect pipeline ID and state for closed container.
> -----------------------------------------------------
>
>                 Key: HDDS-9544
>                 URL: https://issues.apache.org/jira/browse/HDDS-9544
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Pratyush Bhatt
>            Assignee: Aryan Gupta
>            Priority: Minor
>              Labels: pull-request-available
>
> *Steps:*
> 1. Put key in a ozone bucket.
> 2. Stop one of the 3 replica DN.
> 3. Let the re-replicaiton happen, the container will be in CLOSED state post 
> this.
> 4. do a container info on this closed container.
> *Observed behavior:* 
> The pipeline ID keeps on changing on every request.
> {code:java}
> [root@ozn-decom75-1 data184295]# ozone admin container info 2007
> Container id: 2007
> Pipeline id: fa883a43-65d8-4f37-b3ba-d4a3ae1158b1
> Container State: CLOSED
> Datanodes: 
> [93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz]
> Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: 
> 0e65f84a-2920-46dc-a61b-3199aaa1293c; Location: 
> 93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz]
> [root@ozn-decom75-1 data184295]#
> [root@ozn-decom75-1 data184295]#
> [root@ozn-decom75-1 data184295]# ozone admin container info 2007
> Container id: 2007
> Pipeline id: babe680e-53be-4aa5-a43f-8efd1d2e2699
> Container State: CLOSED
> Datanodes: 
> [93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz]
> Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: 
> 0e65f84a-2920-46dc-a61b-3199aaa1293c; Location: 
> 93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz]
> [root@ozn-decom75-1 data184295]#
> [root@ozn-decom75-1 data184295]#
> [root@ozn-decom75-1 data184295]# ozone admin container info 2007
> Container id: 2007
> Pipeline id: 60bce535-4197-4de5-9b6a-b5a3e3d1580e
> Container State: CLOSED
> Datanodes: 
> [93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz]
> Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: 
> 0e65f84a-2920-46dc-a61b-3199aaa1293c; Location: 
> 93650eaf-a971-4d97-ac3c-332acc9e9904/ozn-decom75-9.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6/ozn-decom75-6.ozn-decom75.xyz,
> State: CLOSED; ReplicaIndex: 0; Origin: 351c6c1a-e0f1-4567-b35f-cd70bb4643a6; 
> Location: 21c818e9-f198-42dd-bb88-5de0293a80c8/ozn-decom75-5.ozn-decom75.xyz] 
> {code}
> Can see above that on 3 requests, there are 3 different pipeline IDs. 
> [~sumitagrawal]  helped in debugging(Thanks!), 
> When we check the pipeline ID for container 2007 using:
> {noformat}
> ozone debug ldb --db scm.db scan --with-keys 
> --column_family=containers{noformat}
> it shows below:
> {noformat}
> {
>   "state": "CLOSED",
>   "stateEnterTime": {
>     "seconds": 1698211757,
>     "nanos": 92000000
>   },
>   "pipelineID": {
>     "id": "729e1518-467e-4eb5-b8ef-f4a61dc03920"
>   },
>   "replicationConfig": {
>     "replicationFactor": "THREE"
>   },
>   "clock": {
>     "zone": {
>       "totalSeconds": 0
>     }
>   },
>   "usedBytes": 0,
>   "numberOfKeys": 0,
>   "lastUsed": {
>     "seconds": 1698303048,
>     "nanos": 731000000
>   },
>   "owner": "om146",
>   "containerID": {
>     "id": 2007
>   },
>   "deleteTransactionId": 61,
>   "sequenceId": 0
> },{noformat}
> here the pipeline ID is "729e1518-467e-4eb5-b8ef-f4a61dc03920"
> Looks like it randomly generates the pipelineID on every request, which 
> should not be the case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to