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_r367437908
##########
File path: fe/src/main/java/org/apache/doris/clone/TabletChecker.java
##########
@@ -356,71 +368,72 @@ private void removePriosIfNecessary() {
* when being scheduled.
*/
public void repairTable(AdminRepairTableStmt stmt) throws DdlException {
- Catalog catalog = Catalog.getCurrentCatalog();
- Database db = catalog.getDb(stmt.getDbName());
- if (db == null) {
- throw new DdlException("Database " + stmt.getDbName() + " does not
exist");
- }
+ RepairTabletInfo repairTabletInfo =
getRepairTabletInfo(stmt.getDbName(), stmt.getTblName(), stmt.getPartitions());
+ addPrios(repairTabletInfo.dbId, repairTabletInfo.tblId,
repairTabletInfo.partIds, stmt.getTimeoutS() * 1000);
+ LOG.info("repair database: {}, table: {}, partition: {}",
repairTabletInfo.dbId, repairTabletInfo.tblId, repairTabletInfo.partIds);
+ }
- long dbId = db.getId();
- long tblId = -1;
- List<Long> partIds = Lists.newArrayList();
- db.readLock();
- try {
- Table tbl = db.getTable(stmt.getTblName());
- if (tbl == null || tbl.getType() != TableType.OLAP) {
- throw new DdlException("Table does not exist or is not OLAP
table: " + stmt.getTblName());
+ /*
+ * handle ADMIN CANCEL REPAIR TABLE stmt send by user.
+ * This operation will remove the specified partitions from 'prios'
+ */
+ public void cancelRepairTable(AdminCancelRepairTableStmt stmt) throws
DdlException {
+ RepairTabletInfo repairTabletInfo =
getRepairTabletInfo(stmt.getDbName(), stmt.getTblName(), stmt.getPartitions());
+ removePrios(repairTabletInfo.dbId, repairTabletInfo.tblId,
repairTabletInfo.partIds);
Review comment:
```suggestion
removePrios(repairTabletInfo);
```
----------------------------------------------------------------
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]