w41ter commented on code in PR #38724:
URL: https://github.com/apache/doris/pull/38724#discussion_r1703461611
##########
fe/fe-core/src/main/java/org/apache/doris/backup/BackupJob.java:
##########
@@ -181,6 +230,21 @@ public synchronized boolean
finishTabletSnapshotTask(SnapshotTask task, TFinishT
"make snapshot failed, version already merged");
cancelInternal();
}
+
+ if (request.getTaskStatus().getStatusCode() ==
TStatusCode.TABLET_MISSING) {
+ if (!tryNewTabletSnapshotTask(task)) {
+ status = new Status(ErrCode.NOT_FOUND,
+ "make snapshot failed, failed to ge tablet, table
will be droped or truncated");
+ cancelInternal();
+ }
+ }
Review Comment:
```suggestion
if (request.getTaskStatus().getStatusCode() ==
TStatusCode.TABLET_MISSING
&& !tryNewTabletSnapshotTask(task)) {
status = new Status(ErrCode.NOT_FOUND,
"make snapshot failed, failed to ge tablet, table
will be droped or truncated");
cancelInternal();
}
```
##########
fe/fe-core/src/main/java/org/apache/doris/backup/BackupJob.java:
##########
@@ -169,6 +169,55 @@ public BackupContent getContent() {
return BackupContent.ALL;
}
+ private synchronized boolean tryNewTabletSnapshotTask(SnapshotTask task) {
+ Table table =
env.getInternalCatalog().getTableByTableId(task.getTableId());
+ if (table == null) {
+ return false;
+ }
+ OlapTable tbl = (OlapTable) table;
+ if (tbl.getId() != task.getTableId()) {
+ return false;
+ }
+ Partition partition = tbl.getPartition(task.getPartitionId());
Review Comment:
Here we need to add a read lock for OlapTable
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]