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

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   To build its snapshot version graph, `OmSnapshotLocalDataManager` only needs 
each snapshot local data YAML's `snapshotId`, `previousSnapshotId`, `version` 
and the `previousSnapshotVersion` of each version. Every load still builds all 
`SstFileInfo` entries, which make up almost the whole file, and then throws 
them away. With many snapshots this is most of the CPU cost of OM startup.
   
   Timing one 9 MB YAML from a cluster with about 19k snapshots (one version, 
about 36.7k `SstFileInfo` entries):
   * Full load: 0.153 s per file (59 MB/s)
   * Load without SST file lists: 0.088 s per file (103 MB/s)
   
   This PR:
   * Adds a load mode to `OmSnapshotLocalDataYaml` (`YamlFactory(true)`) that 
drops each version's `sstFiles` node before construction, so none of its 
entries are built. All other fields load as before.
   * Uses this mode in `OmSnapshotLocalDataManager` only for building the 
version graph (`init` and the previous snapshot walk). All other reads and 
every write still use the full serializer.
   * Makes the serializer used in this mode refuse to save, so data loaded 
without SST file lists cannot overwrite a YAML.
   
   Compatibility: the on disk format is unchanged. New code reads YAMLs written 
by existing releases, and nothing new is written.
   
   One behavior change: startup still parses the whole document, so files that 
are not valid YAML are still skipped as before. But invalid values inside SST 
file entries are no longer detected at startup; they show up on the next full 
load of that snapshot.
   
   This change is independent of HDDS-17078 (parse each YAML once at startup, 
#11575). The speedups combine.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17079
   
   ## How was this patch tested?
   
   * Added `TestOmSnapshotLocalDataYaml#testLoadWithoutSstFiles`: a YAML 
written by the regular serializer loads in the new mode with the same snapshot 
ids, versions, `previousSnapshotVersion` values, checksum and transaction info, 
and with empty SST file lists.
   * `TestOmSnapshotLocalDataManager`, `TestOmSnapshotLocalDataYaml` and 
`TestSnapshotDefragService` pass locally on master.
   * Checkstyle passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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