Commit acd3b29
authored
Fix concurrent append to interval with only unused segments (#18216)
Bug:
Concurrent append uses lock of type APPEND which always uses a lock version of epoch 1970-01-01.
This can cause data loss in a flow as follows:
- Ingest data using an APPEND task to an empty interval
- Mark all the segments as unused
- Re-run the APPEND task
- Data is not visible since old segment IDs (now unused) are allocated again
Fix:
In segment allocation, do not reuse an old segment ID, used or unused.
This fix was already done for some cases back in #16380 .
An embedded test for this has been included in #182071 parent f2a95fa commit acd3b29
File tree
2 files changed
+35
-1
lines changed- indexing-service/src/test/java/org/apache/druid/indexing/common/task/concurrent
- server/src/main/java/org/apache/druid/metadata
2 files changed
+35
-1
lines changedLines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1122 | 1154 | | |
1123 | 1155 | | |
1124 | 1156 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
| 1422 | + | |
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
| |||
1555 | 1556 | | |
1556 | 1557 | | |
1557 | 1558 | | |
1558 | | - | |
| 1559 | + | |
1559 | 1560 | | |
1560 | 1561 | | |
1561 | 1562 | | |
1562 | 1563 | | |
1563 | 1564 | | |
| 1565 | + | |
1564 | 1566 | | |
1565 | 1567 | | |
1566 | 1568 | | |
| |||
0 commit comments