smengcl commented on code in PR #8555:
URL: https://github.com/apache/ozone/pull/8555#discussion_r2136569583
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -86,8 +87,20 @@ public class SstFilteringService extends BackgroundService
private final BootstrapStateHandler.Lock lock = new
BootstrapStateHandler.Lock();
public static boolean isSstFiltered(OzoneConfiguration ozoneConfiguration,
SnapshotInfo snapshotInfo) {
- Path sstFilteredFile =
Paths.get(OmSnapshotManager.getSnapshotPath(ozoneConfiguration,
- snapshotInfo), SST_FILTERED_FILE);
+ // First try to read the flag from YAML file
+ String yamlPath =
OmSnapshotManager.getSnapshotLocalPropertyYamlPath(ozoneConfiguration,
snapshotInfo);
+
+ try (OmSnapshotLocalProperty localProperties = new
OmSnapshotLocalPropertyYamlImpl(yamlPath)) {
Review Comment:
Agree. If we want it to be race-free, an easy thought would be to guard r/w
access behind `SnapshotCache` r/w lock. But one thing I don't like is that it
implies we are opening the snapshot DB just for reading the yaml metadata
(assuming no major refactoring of the SnapshotCache).
Let me see if `flock` would work..
--
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]