Skip to content

Commit

Permalink
fix log_pointer handle from system.replicas during restore, fix #967
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Oct 22, 2024
1 parent 6640289 commit 5ff4648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ IMPROVEMENTS

BUG FIXES
- fix `TestLongListRemote` for properly time measurement
- fix log_pointer handle from system.replicas during restore, fix [967](https://github.com/Altinity/clickhouse-backup/issues/967)

# v2.6.2
BUG FIXES
Expand Down
3 changes: 2 additions & 1 deletion pkg/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,8 @@ func (ch *ClickHouse) CheckReplicationInProgress(table metadata.TableMetadata) (
if len(existsReplicas) > 1 {
return false, fmt.Errorf("invalid result for check exists replicas: %+v", existsReplicas)
}
if existsReplicas[0].LogPointer > 1 || existsReplicas[0].LogMaxIndex > 1 || existsReplicas[0].AbsoluteDelay > 0 || existsReplicas[0].QueueSize > 0 {
// https://github.com/Altinity/clickhouse-backup/issues/967
if existsReplicas[0].LogPointer > 2 || existsReplicas[0].LogMaxIndex > 1 || existsReplicas[0].AbsoluteDelay > 0 || existsReplicas[0].QueueSize > 0 {
return false, fmt.Errorf("%s.%s can't restore cause system.replicas entries already exists and replication in progress from another replica, log_pointer=%d, log_max_index=%d, absolute_delay=%d, queue_size=%d", table.Database, table.Table, existsReplicas[0].LogPointer, existsReplicas[0].LogMaxIndex, existsReplicas[0].AbsoluteDelay, existsReplicas[0].QueueSize)
} else {
log.Info().Msgf("replication_in_progress status = %+v", existsReplicas)
Expand Down

0 comments on commit 5ff4648

Please sign in to comment.