morningman commented on a change in pull request #2763: [Alter]Add wait time
while doing alter options
URL: https://github.com/apache/incubator-doris/pull/2763#discussion_r367436403
##########
File path: fe/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java
##########
@@ -184,13 +184,22 @@ protected void runPendingJob() throws
AlterCancelException {
totalReplicaNum += tablet.getReplicas().size();
}
}
- MarkedCountDownLatch<Long, Long> countDownLatch = new
MarkedCountDownLatch<Long, Long>(totalReplicaNum);
+ MarkedCountDownLatch<Long, Long> countDownLatch = new
MarkedCountDownLatch<>(totalReplicaNum);
db.readLock();
try {
OlapTable tbl = (OlapTable) db.getTable(tableId);
if (tbl == null) {
throw new AlterCancelException("Table " + tableId + " does not
exist");
- }
+ }
+
+ boolean isStable = tbl.isStable(Catalog.getCurrentSystemInfo(),
+ Catalog.getCurrentCatalog().getTabletScheduler(),
+ db.getClusterName());
+ if (!isStable) {
+ LOG.warn("doing schema change job while table is not stable,
wait until tablet to be repaired.");
Review comment:
You can add this error msg to the `errMsg` of the AlterJob, so that user can
see what happen.
And this log should contains job id for debugging. And in `errMsg`, it can
be shorten, eg, "table is unstable".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]