Skip to content

Commit

Permalink
Store status on activate task
Browse files Browse the repository at this point in the history
No description

---

Pull Request resolved: #126
commit_hash:aa86b1b4e203823526f65e5b6d87cccfdba82864
  • Loading branch information
laskoviymishka authored and robot-piglet committed Dec 2, 2024
1 parent 18fe8a6 commit 67879cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions cmd/trcli/activate/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func RunActivate(
time.Sleep(extraWait)
}
}()
if err := cp.RemoveTransferState(transfer.ID, []string{"status"}); err != nil {
return xerrors.Errorf("unable to cleanup status state: %w", err)
}
logger.Log.Infof("run activate with: %T", cp)
op := new(model.TransferOperation)
op.OperationID = transfer.ID + "/activation"
Expand Down Expand Up @@ -87,5 +90,17 @@ func RunActivate(
for _, p := range pcp.Progress() {
logger.Log.Infof(" part: %s 👌 %v rows in %v", p.String(), p.CompletedRows, time.Since(st))
}
if err := cp.SetTransferState(transfer.ID, map[string]*coordinator.TransferStateData{
"status": {
Generic: "activated",
IncrementalTables: nil,
OraclePosition: nil,
MysqlGtid: nil,
MysqlBinlogPosition: nil,
YtStaticPart: nil,
},
}); err != nil {
return xerrors.Errorf("unable to set transfer state: %w", err)
}
return nil
}
2 changes: 1 addition & 1 deletion pkg/providers/clickhouse/sink_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (c *sinkCluster) DropTable(tableName string) error {
func (c *sinkCluster) execDDL(executor func(distributed bool) error) error {
c.distributedDDLMu.Lock()

if c.distributedDDLEnabled == nil && c.topology.ClusterName() == "" {
if c.distributedDDLEnabled == nil && (c.topology.ClusterName() == "" || c.topology.SingleNode()) {
if !c.topology.SingleNode() {
return xerrors.Errorf("resolved empty cluster name for non-single-node cluster")
}
Expand Down

0 comments on commit 67879cc

Please sign in to comment.