This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new fc4fc05b0 [hotfix] Add exception message for
append-only.assert-disorder
fc4fc05b0 is described below
commit fc4fc05b0b7e05b2eebee5e25349472a306d5236
Author: JingsongLi <[email protected]>
AuthorDate: Mon Apr 3 10:53:22 2023 +0800
[hotfix] Add exception message for append-only.assert-disorder
---
.../java/org/apache/paimon/append/AppendOnlyCompactManager.java | 6 ++++--
.../org/apache/paimon/append/AppendOnlyCompactManagerTest.java | 8 ++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyCompactManager.java
b/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyCompactManager.java
index a5dbf4f5a..4ff3bb795 100644
---
a/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyCompactManager.java
+++
b/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyCompactManager.java
@@ -327,8 +327,10 @@ public class AppendOnlyCompactManager extends
CompactFutureManager {
if (assertDisorder && isOverlap(o1, o2)) {
throw new RuntimeException(
String.format(
- "There should no overlap in append files,
there is a bug!"
- + " Range1(%s, %s), Range2(%s, %s)",
+ "There should no overlap in append files, but
Range1(%s, %s), Range2(%s, %s).\n "
+ + "If you are recovering from an older
version of paimon (<= 0.3), "
+ + "you can configure
'append-only.assert-disorder'='false' to avoid exceptions. \n "
+ + "If it was not restored from an
older version, there is a bug!",
o1.minSequenceNumber(),
o1.maxSequenceNumber(),
o2.minSequenceNumber(),
diff --git
a/paimon-core/src/test/java/org/apache/paimon/append/AppendOnlyCompactManagerTest.java
b/paimon-core/src/test/java/org/apache/paimon/append/AppendOnlyCompactManagerTest.java
index 73126d1b3..045902c7a 100644
---
a/paimon-core/src/test/java/org/apache/paimon/append/AppendOnlyCompactManagerTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/append/AppendOnlyCompactManagerTest.java
@@ -205,7 +205,7 @@ public class AppendOnlyCompactManagerTest {
newFileFromSequence("1", 11, 0, 20),
newFileFromSequence("2", 13, 20, 30)))
.hasMessageContaining(
- "There should no overlap in append files, there is a
bug! Range1(0, 20), Range2(20, 30)");
+ "There should no overlap in append files, but
Range1(0, 20), Range2(20, 30)");
assertThatThrownBy(
() ->
@@ -213,7 +213,7 @@ public class AppendOnlyCompactManagerTest {
newFileFromSequence("1", 11, 20, 30),
newFileFromSequence("2", 13, 0, 20)))
.hasMessageContaining(
- "There should no overlap in append files, there is a
bug! Range1(20, 30), Range2(0, 20)");
+ "There should no overlap in append files, but
Range1(20, 30), Range2(0, 20)");
assertThatThrownBy(
() ->
@@ -221,7 +221,7 @@ public class AppendOnlyCompactManagerTest {
newFileFromSequence("1", 11, 0, 30),
newFileFromSequence("2", 13, 10, 20)))
.hasMessageContaining(
- "There should no overlap in append files, there is a
bug! Range1(0, 30), Range2(10, 20)");
+ "There should no overlap in append files, but
Range1(0, 30), Range2(10, 20)");
assertThatThrownBy(
() ->
@@ -229,7 +229,7 @@ public class AppendOnlyCompactManagerTest {
newFileFromSequence("1", 11, 10, 20),
newFileFromSequence("2", 13, 0, 30)))
.hasMessageContaining(
- "There should no overlap in append files, there is a
bug! Range1(10, 20), Range2(0, 30)");
+ "There should no overlap in append files, but
Range1(10, 20), Range2(0, 30)");
}
private void innerTest(