Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public ProcResult fetchResult() throws AnalysisException {
partition.getVisibleVersion(), partition.getVisibleVersionHash(),
replicationNum);

if (res.first != TabletStatus.HEALTHY) {
// here we treat REDUNDANT as HEALTHY, for user friendly.
if (res.first != TabletStatus.HEALTHY && res.first != TabletStatus.REDUNDANT) {
unhealthyTabletIds.put(dbId, tablet.getId());
}

Expand Down
18 changes: 14 additions & 4 deletions fe/src/main/java/org/apache/doris/load/Load.java
Original file line number Diff line number Diff line change
Expand Up @@ -3008,12 +3008,12 @@ private void checkDelete(OlapTable table, Partition partition, List<Predicate> c
}
}

private void checkAndAddRunningSyncDeleteJob(long partitionId, String partitionName) throws DdlException {
private boolean checkAndAddRunningSyncDeleteJob(long partitionId, String partitionName) throws DdlException {
// check if there are synchronized delete job under going
writeLock();
try {
checkHasRunningSyncDeleteJob(partitionId, partitionName);
partitionUnderDelete.add(partitionId);
return partitionUnderDelete.add(partitionId);
} finally {
writeUnlock();
}
Expand Down Expand Up @@ -3073,6 +3073,7 @@ public void delete(DeleteStmt stmt) throws DdlException {
long tableId = -1;
long partitionId = -1;
LoadJob loadDeleteJob = null;
boolean addRunningPartition = false;
db.readLock();
try {
Table table = db.getTable(tableName);
Expand Down Expand Up @@ -3110,7 +3111,7 @@ public void delete(DeleteStmt stmt) throws DdlException {
// pre check
checkDeleteV2(olapTable, partition, conditions,
deleteConditions, true);
checkAndAddRunningSyncDeleteJob(partitionId, partitionName);
addRunningPartition = checkAndAddRunningSyncDeleteJob(partitionId, partitionName);
// do not use transaction id generator, or the id maybe duplicated
long jobId = Catalog.getInstance().getNextId();
String jobLabel = "delete_" + UUID.randomUUID();
Expand All @@ -3137,11 +3138,20 @@ public void delete(DeleteStmt stmt) throws DdlException {
// the delete job will be persist in editLog
addLoadJob(loadDeleteJob, db);
} catch (Throwable t) {
LOG.debug("error occurred during prepare delete", t);
LOG.warn("error occurred during prepare delete", t);
throw new DdlException(t.getMessage(), t);
} finally {
if (addRunningPartition) {
writeLock();
try {
partitionUnderDelete.remove(partitionId);
} finally {
writeUnlock();
}
}
db.readUnlock();
}

try {
// TODO wait loadDeleteJob to finished, using while true? or condition wait
long startDeleteTime = System.currentTimeMillis();
Expand Down