You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "leaves12138 (via GitHub)" <gi...@apache.org> on 2024/09/23 08:13:46 UTC
[PR] [core] Check existence before expire [paimon]
leaves12138 opened a new pull request, #4235:
URL: https://github.com/apache/paimon/pull/4235
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
If there is two writing job directly aiming to two different partitions, then there'll come up a conflict while expiring snapshot. This should be avoided.
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Check snapshot existence before expire [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #4235:
URL: https://github.com/apache/paimon/pull/4235
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Check snapshot existence before expire [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #4235:
URL: https://github.com/apache/paimon/pull/4235#discussion_r1771039426
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -162,21 +163,27 @@ public int expireUntil(long earliestId, long endExclusiveId) {
if (LOG.isDebugEnabled()) {
LOG.debug("Ready to delete merge tree files not used by snapshot #" + id);
}
- Snapshot snapshot = snapshotManager.snapshot(id);
- // expire merge tree files and collect changed buckets
- Predicate<ManifestEntry> skipper;
- try {
- skipper = snapshotDeletion.createDataFileSkipperForTags(taggedSnapshots, id);
- } catch (Exception e) {
- LOG.info(
- String.format(
- "Skip cleaning data files of snapshot '%s' due to failed to build skipping set.",
- id),
- e);
- continue;
- }
-
- snapshotDeletion.cleanUnusedDataFiles(snapshot, skipper);
+ final long snapshotId = id;
+ quietExecute(
Review Comment:
How about:
```
Snapshot snapshot;
try {
snapshot = snapshotManager.tryGetSnapshot(id);
} catch (FileNotFoundException e) {
beginInclusiveId = id + 1;
continue;
}
```
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org