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/27 08:34:02 UTC
[PR] [core] Check existence before expire: more check. [paimon]
leaves12138 opened a new pull request, #4272:
URL: https://github.com/apache/paimon/pull/4272
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Two place need to check
<!-- 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 existence before expire: more check. [paimon]
Posted by "leaves12138 (via GitHub)" <gi...@apache.org>.
leaves12138 merged PR #4272:
URL: https://github.com/apache/paimon/pull/4272
--
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 existence before expire: more check. [paimon]
Posted by "leaves12138 (via GitHub)" <gi...@apache.org>.
leaves12138 commented on code in PR #4272:
URL: https://github.com/apache/paimon/pull/4272#discussion_r1778319167
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -213,8 +214,25 @@ public int expireUntil(long earliestId, long endExclusiveId) {
List<Snapshot> skippingSnapshots =
SnapshotManager.findOverlappedSnapshots(
taggedSnapshots, beginInclusiveId, endExclusiveId);
- skippingSnapshots.add(snapshotManager.snapshot(endExclusiveId));
- Set<String> skippingSet = snapshotDeletion.manifestSkippingSet(skippingSnapshots);
+
+ try {
+ skippingSnapshots.add(snapshotManager.tryGetSnapshot(endExclusiveId));
+ } catch (FileNotFoundException e) {
+ // the end exclusive snapshot is gone
+ // there is no need to proceed
+ return 0;
+ }
+
+ Set<String> skippingSet = new HashSet<>();
+ try {
+ skippingSet.addAll(snapshotDeletion.manifestSkippingSet(skippingSnapshots));
+ } catch (Exception e) {
+ // mayby snapshot been deleted by other jobs.
Review Comment:
See 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 existence before expire: more check. [paimon]
Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on code in PR #4272:
URL: https://github.com/apache/paimon/pull/4272#discussion_r1778361170
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -213,8 +214,25 @@ public int expireUntil(long earliestId, long endExclusiveId) {
List<Snapshot> skippingSnapshots =
SnapshotManager.findOverlappedSnapshots(
taggedSnapshots, beginInclusiveId, endExclusiveId);
- skippingSnapshots.add(snapshotManager.snapshot(endExclusiveId));
- Set<String> skippingSet = snapshotDeletion.manifestSkippingSet(skippingSnapshots);
+
+ try {
+ skippingSnapshots.add(snapshotManager.tryGetSnapshot(endExclusiveId));
+ } catch (FileNotFoundException e) {
+ // the end exclusive snapshot is gone
+ // there is no need to proceed
+ return 0;
+ }
+
+ Set<String> skippingSet = new HashSet<>();
+ try {
+ skippingSet.addAll(snapshotDeletion.manifestSkippingSet(skippingSnapshots));
+ } catch (Exception e) {
+ // mayby snapshot been deleted by other jobs.
Review Comment:
OK
--
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 existence before expire: more check. [paimon]
Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on code in PR #4272:
URL: https://github.com/apache/paimon/pull/4272#discussion_r1778313649
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -213,8 +214,25 @@ public int expireUntil(long earliestId, long endExclusiveId) {
List<Snapshot> skippingSnapshots =
SnapshotManager.findOverlappedSnapshots(
taggedSnapshots, beginInclusiveId, endExclusiveId);
- skippingSnapshots.add(snapshotManager.snapshot(endExclusiveId));
- Set<String> skippingSet = snapshotDeletion.manifestSkippingSet(skippingSnapshots);
+
+ try {
+ skippingSnapshots.add(snapshotManager.tryGetSnapshot(endExclusiveId));
+ } catch (FileNotFoundException e) {
+ // the end exclusive snapshot is gone
+ // there is no need to proceed
+ return 0;
+ }
+
+ Set<String> skippingSet = new HashSet<>();
+ try {
+ skippingSet.addAll(snapshotDeletion.manifestSkippingSet(skippingSnapshots));
+ } catch (Exception e) {
+ // mayby snapshot been deleted by other jobs.
+ if (e.getCause() == null || !(e.getCause() instanceof FileNotFoundException)) {
+ throw e;
+ }
Review Comment:
Add a log here?
Explain why we catch Exception here and no longer throw them out.
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -213,8 +214,25 @@ public int expireUntil(long earliestId, long endExclusiveId) {
List<Snapshot> skippingSnapshots =
SnapshotManager.findOverlappedSnapshots(
taggedSnapshots, beginInclusiveId, endExclusiveId);
- skippingSnapshots.add(snapshotManager.snapshot(endExclusiveId));
- Set<String> skippingSet = snapshotDeletion.manifestSkippingSet(skippingSnapshots);
+
+ try {
+ skippingSnapshots.add(snapshotManager.tryGetSnapshot(endExclusiveId));
+ } catch (FileNotFoundException e) {
+ // the end exclusive snapshot is gone
+ // there is no need to proceed
+ return 0;
+ }
+
+ Set<String> skippingSet = new HashSet<>();
+ try {
+ skippingSet.addAll(snapshotDeletion.manifestSkippingSet(skippingSnapshots));
+ } catch (Exception e) {
+ // mayby snapshot been deleted by other jobs.
Review Comment:
mayby?
--
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