[fix](cooldown) Fix potential data loss when clone task's dst tablet is cooldown replica (#17644)

Co-authored-by: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com>
Co-authored-by: Kang <kxiao.tiger@gmail.com>
This commit is contained in:
plat1ko
2023-09-01 15:27:52 +08:00
committed by GitHub
parent 91c5640cae
commit 9d2fc78bd5
3 changed files with 21 additions and 2 deletions

View File

@ -925,6 +925,8 @@ public class TabletSchedCtx implements Comparable<TabletSchedCtx> {
committedVersion, /* use committed version as last failed version */
-1 /* last success version */);
LOG.info("create clone task to make new replica, tabletId={}, replicaId={}", tabletId,
cloneReplica.getId());
// addReplica() method will add this replica to tablet inverted index too.
tablet.addReplica(cloneReplica);
replicaId = cloneReplica.getId();
@ -950,6 +952,7 @@ public class TabletSchedCtx implements Comparable<TabletSchedCtx> {
replicaId, schemaHash, Lists.newArrayList(tSrcBe), storageMedium,
visibleVersion, (int) (taskTimeoutMs / 1000));
cloneTask.setPathHash(srcPathHash, destPathHash);
LOG.info("create clone task to repair replica, tabletId={}, replicaId={}", tabletId, replicaId);
this.state = State.RUNNING;
return cloneTask;