sreejasahithi opened a new pull request, #10547:
URL: https://github.com/apache/ozone/pull/10547

   ## What changes were proposed in this pull request?
   This PR extends `ozone debug datanode container analyze` with optional SCM 
metadata lookup via --scm-db option.
   
   When a scm.db path is provided, the command classifies each container ID 
found during the on-disk DataNode scan 
[HDDS-15455](https://issues.apache.org/jira/browse/HDDS-15455) against SCM 
metadata and reports:
   
     - Orphan containers (wrt SCM): present on disk but not in SCM
     - Deleted but present containers: present on disk but marked DELETED in SCM
   
   Containers in SCM with any other lifecycle state are skipped. Without 
--scm-db, the command prints a hint that SCM lookup is required for orphan and 
deleted-but-present detection and displays only the duplicate container 
information.
   
   ## What is the link to the Apache JIRA
   
   [HDDS-15456](https://issues.apache.org/jira/browse/HDDS-15456)
   
   ## How was this patch tested?
   
   Tested in docker cluster by manually creating the inconsistencies
   Sample output:
   ```
   bash-5.1$ ozone debug datanode container analyze --scm-db /tmp/scm-offline
   Number of orphan containers(wrt SCM) on this DataNode: 2
   Container 21 (2 occurrences):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=VALID size=82486 bytes
   
    
path=/data/hdds4/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=MISSING_METADATA size=81920 bytes
   
   Container 22 (1 occurrence):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/22
    status=VALID size=82486 bytes
   
   Number of deleted but present containers on this DataNode: 0
   Number of containers with duplicate container directories on this DataNode: 2
   Container 10 (2 occurrences):
    
path=/data/hdds2/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/10
    status=VALID size=62223 bytes
   
    
path=/data/hdds3/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/10
    status=VALID size=62223 bytes
   
   Container 21 (2 occurrences):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=VALID size=82486 bytes
   
    
path=/data/hdds4/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=MISSING_METADATA size=81920 bytes
   
   bash-5.1$
   ```
   
   ```
   bash-5.1$ ozone debug datanode container analyze --scm-db 
/tmp/scm-offline-deleted
   Number of orphan containers(wrt SCM) on this DataNode: 2
   Container 21 (2 occurrences):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=VALID size=82486 bytes
   
    
path=/data/hdds4/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=MISSING_METADATA size=81920 bytes
   
   Container 22 (1 occurrence):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/22
    status=VALID size=82486 bytes
   
   Number of deleted but present containers on this DataNode: 2
   Container 5 (1 occurrence):
    
path=/data/hdds2/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/5
    status=VALID size=72493 bytes
   
   Container 10 (1 occurrence):
    
path=/data/hdds2/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/10
    status=VALID size=62223 bytes
   
   Number of containers with duplicate container directories on this DataNode: 1
   Container 21 (2 occurrences):
    
path=/data/hdds0/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=VALID size=82486 bytes
   
    
path=/data/hdds4/hdds/CID-cdb372ce-9eb0-4738-adb6-99882aa95a56/current/containerDir0/21
    status=MISSING_METADATA size=81920 bytes
   
   bash-5.1$
   ```
   
   


-- 
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]

Reply via email to