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

   ## What changes were proposed in this pull request?
   
   Sometimes we have seen cases when a particular raft log can't be applied 
because of some issue on OM restart. A repair tool to skip that transaction and 
move forward to bring up the service back is needed.
   In the simple case when transaction in transactionInfoTable is just a 
transaction behind than to the raft transaction it is failing for, we can use 
[HDDS-8097](https://issues.apache.org/jira/browse/HDDS-8097) but for the 
scenario when gap between the transaction in transactionInfoTable and failing 
transaction is more than one, we can use this tool to skip particular raft log.
   
   Sample usage:
   `ozone repair om ratislogrepair -s=/path/log_0-8 -o=/path/temp/log_0-8 
--index=3`
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-10822
   
   ## How was this patch tested?
   
   Manually tested:
   original segment file:
   ```
   bash-4.2$ ozone debug ratislogparser om -s=/patht/log_0-8
   Dumping OM Ratis Log
   Processing Raft Log file: 
/data/metadata/ratis/5cb24680-b9e7-3c90-a862-d66704efc61c/current/log_0-8 
size:704
   (t:1, i:0), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"startupRole:FOLLOWER, 
id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, old:)
   (t:1, i:1), STATEMACHINELOGENTRY, cmdType: CreateVolume traceID: "" 
clientId: "client-1BB320A478DF" userInfo { userName: "hadoop" remoteAddress: 
"172.18.0.8" hostName: "ozone-ha-om1-1.ozone-ha_default" } version: 3 
createVolumeRequest { volumeInfo { adminName: "hadoop" ownerName: "hadoop" 
volume: "vol1" quotaInBytes: 18446744073709551615 creationTime: 1742884475168 
objectID: 0 updateID: 0 modificationTime: 1742884475168 quotaInNamespace: -1 
usedNamespace: 0 refCount: 0 } }
   (t:1, i:2), METADATAENTRY(c:1)
   (t:1, i:3), STATEMACHINELOGENTRY, cmdType: CreateBucket traceID: "" 
clientId: "client-2F5BE0470890" userInfo { userName: "hadoop" remoteAddress: 
"172.18.0.8" hostName: "ozone-ha-om1-1.ozone-ha_default" } version: 3 
createBucketRequest { bucketInfo { volumeName: "vol1" bucketName: "bb1" 
isVersionEnabled: false storageType: DISK creationTime: 1742884512220 objectID: 
0 updateID: 0 modificationTime: 1742884512220 usedBytes: 0 quotaInBytes: -1 
quotaInNamespace: -1 usedNamespace: 0 owner: "hadoop" } }
   (t:1, i:4), METADATAENTRY(c:3)
   (t:1, i:5), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"priority:1startupRole:FOLLOWER,
 id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, 
old:id:"om1"address:"om1:9872"startupRole:FOLLOWER, 
id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER)
   (t:1, i:6), METADATAENTRY(c:5)
   (t:1, i:7), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"priority:1startupRole:FOLLOWER,
 id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, old:)
   (t:1, i:8), METADATAENTRY(c:7)
   Num Total Entries: 9
   Num Conf Entries: 3
   Num Metadata Entries: 4
   Num StateMachineEntries Entries: 2
   Num Invalid Entries: 0
   ```
   Newly created file by the tool:
   ```
   ozone debug ratislogparser om -s=/path/temp/log_0-8
   Dumping OM Ratis Log
   Processing Raft Log file: /Users/tejaskriya.madhan/Desktop/temp/log_0-8 
size:629
   (t:1, i:0), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"startupRole:FOLLOWER, 
id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, old:)
   (t:1, i:1), STATEMACHINELOGENTRY, cmdType: CreateVolume traceID: "" 
clientId: "client-1BB320A478DF" userInfo { userName: "hadoop" remoteAddress: 
"172.18.0.8" hostName: "ozone-ha-om1-1.ozone-ha_default" } version: 3 
createVolumeRequest { volumeInfo { adminName: "hadoop" ownerName: "hadoop" 
volume: "vol1" quotaInBytes: 18446744073709551615 creationTime: 1742884475168 
objectID: 0 updateID: 0 modificationTime: 1742884475168 quotaInNamespace: -1 
usedNamespace: 0 refCount: 0 } }
   (t:1, i:2), METADATAENTRY(c:1)
   (t:1, i:3), STATEMACHINELOGENTRY, cmdType: EchoRPC traceID: "" clientId: 
"client-2F5BE0470890" userInfo { userName: "hadoop" remoteAddress: "172.18.0.8" 
hostName: "ozone-ha-om1-1.ozone-ha_default" } version: 3 EchoRPCRequest { }
   (t:1, i:4), METADATAENTRY(c:3)
   (t:1, i:5), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"priority:1startupRole:FOLLOWER,
 id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, 
old:id:"om1"address:"om1:9872"startupRole:FOLLOWER, 
id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER)
   (t:1, i:6), METADATAENTRY(c:5)
   (t:1, i:7), 
CONFIGURATIONENTRY(current:id:"om1"address:"om1:9872"priority:1startupRole:FOLLOWER,
 id:"om3"address:"om3:9872"startupRole:FOLLOWER, 
id:"om2"address:"om2:9872"startupRole:FOLLOWER, old:)
   (t:1, i:8), METADATAENTRY(c:7)
   Num Total Entries: 9
   Num Conf Entries: 3
   Num Metadata Entries: 4
   Num StateMachineEntries Entries: 2
   Num Invalid Entries: 0
   
   ```
   


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