Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][rollback] Skip non-existent snapshots in rollback #3733

Merged

Conversation

FangYongs
Copy link
Contributor

Purpose

Linked issue: close #3732

Skip non-existent snapshots in rollback operation

Tests

Added FileStoreTableTestBase#testRollbackToSnapshotSkipNonExistentSnapshot

API and Format

no

Documentation

no

@JingsongLi
Copy link
Contributor

Hi @FangYongs , you can show the exception stack first, and we can decide how to solve this problem.

@FangYongs
Copy link
Contributor Author

FangYongs commented Jul 12, 2024

@JingsongLi Our version is 0.6 and the root cause is as follows,:
Caused by: java.io.FileNotFoundException: No such file or directory: hdfs://xxxx
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:899) ~[flink-shaded-hadoop-2-uber-3.2.1-1.5.2.26-16.0-byted-20240514.084713-1.jar:3.2.1-1.5.2.26-16.0-byted-SNAPSHOT]
at org.apache.flink.runtime.fs.hdfs.HadoopFileSystem.open(HadoopFileSystem.java:131) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
at org.apache.flink.runtime.fs.hdfs.HadoopFileSystem.open(HadoopFileSystem.java:37) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
at org.apache.paimon.flink.FlinkFileIO.newInputStream(FlinkFileIO.java:63) ~[?:?]
at org.apache.paimon.fs.FileIO.readFileUtf8(FileIO.java:194) ~[?:?]
at org.apache.paimon.Snapshot.fromPath(Snapshot.java:419) ~[?:?]
at org.apache.paimon.utils.SnapshotManager.snapshot(SnapshotManager.java:90) ~[?:?]
at org.apache.paimon.table.RollbackHelper.cleanSnapshotsDataFiles(RollbackHelper.java:106) ~[?:?]
at org.apache.paimon.table.RollbackHelper.cleanLargerThan(RollbackHelper.java:70) ~[?:?]

at org.apache.paimon.table.AbstractFileStoreTable.rollbackTo(AbstractFileStoreTable.java:396) ~[?:?]
at org.apache.paimon.flink.action.RollbackToAction.run(RollbackToAction.java:54) ~[?:?]
at org.apache.paimon.flink.action.FlinkActions.main(FlinkActions.java:41) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_362]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_362]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_362]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362]
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:392) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:235) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:98) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:301) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT]
... 12 more

@JingsongLi
Copy link
Contributor

@JingsongLi Our version is 0.6 and the root cause is as follows,: Caused by: java.io.FileNotFoundException: No such file or directory: hdfs://xxxx at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:899) ~[flink-shaded-hadoop-2-uber-3.2.1-1.5.2.26-16.0-byted-20240514.084713-1.jar:3.2.1-1.5.2.26-16.0-byted-SNAPSHOT] at org.apache.flink.runtime.fs.hdfs.HadoopFileSystem.open(HadoopFileSystem.java:131) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] at org.apache.flink.runtime.fs.hdfs.HadoopFileSystem.open(HadoopFileSystem.java:37) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] at org.apache.paimon.flink.FlinkFileIO.newInputStream(FlinkFileIO.java:63) ~[?:?] at org.apache.paimon.fs.FileIO.readFileUtf8(FileIO.java:194) ~[?:?] at org.apache.paimon.Snapshot.fromPath(Snapshot.java:419) ~[?:?] at org.apache.paimon.utils.SnapshotManager.snapshot(SnapshotManager.java:90) ~[?:?] at org.apache.paimon.table.RollbackHelper.cleanSnapshotsDataFiles(RollbackHelper.java:106) ~[?:?] at org.apache.paimon.table.RollbackHelper.cleanLargerThan(RollbackHelper.java:70) ~[?:?] at org.apache.paimon.table.AbstractFileStoreTable.rollbackTo(AbstractFileStoreTable.java:396) ~[?:?] at org.apache.paimon.flink.action.RollbackToAction.run(RollbackToAction.java:54) ~[?:?] at org.apache.paimon.flink.action.FlinkActions.main(FlinkActions.java:41) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_362] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_362] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_362] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362] at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:392) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:235) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:98) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:301) ~[flink-dist-1.16-byted-SNAPSHOT.jar:1.16-byted-SNAPSHOT] ... 12 more

Thanks, I see

@FangYongs FangYongs force-pushed the rollback-skip-non-existent-snapshot branch from df29564 to fb1690d Compare July 12, 2024 10:34
Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi JingsongLi merged commit d6a10fa into apache:master Jul 15, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Ignore invalid snapshot when rollback to specific snapshot
2 participants