hemantk-12 opened a new pull request, #5317:
URL: https://github.com/apache/ozone/pull/5317

   ## What changes were proposed in this pull request?
   In Jira: [HDDS-7601](https://issues.apache.org/jira/browse/HDDS-7601) and 
[PR#5303](https://github.com/apache/ozone/pull/5303/), a new column family: 
`compactionLogTable` was added to RocksDB to store compaction information but 
it was not used.
   This change is to actually use `compactionLogTable` column family to store 
compaction information in RocksDB. And make sure code is backward and forward 
compatibility.
   
   1. `RocksDB` and `ColumnFamliy` are directly used to access the 
`compactionLogTable` instead of using 
[Table](https://github.com/apache/ozone/blob/master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/Table.java)/[RDBTable](https://github.com/apache/ozone/blob/master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBTable.java).
 Reason being, dependency structure is `rocksdb-checkpoint-differ` -> 
`hdds-server-framework` -> `ozone-manager`. If Table/RDBTable is used in ` 
rocksdb-checkpoint-differ `, it will create cyclic dependency which is not 
allowed. Hence have to use `RocksDB` and `ColumnFamliy` to access 
`compactionLogTable`.
   
   2. For backward and forward compatibility, on service startup when 
`RocksDBCheckpointDiffer#loadAllCompactionLogs` gets called, compaction files 
are read from previous format (compaction text file) and compaction entries are 
added to the `CompactionLogTable`, [here](code-link). Once all the compaction 
entries are added to the table, compaction log files get deleted, 
[here](code-link). It is OK to delete file because in case of rollback some 
compaction entries will be missing because new code will write to only to 
`CompactionLogTable`. More details in 
[discussion](https://github.com/apache/ozone/pull/5236#discussion_r1320175210).
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-9311
   
   ## How was this patch tested?
   Unit tests were updated with to run for new compaction log format as well as 
old format.
   


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