Skip to content

Commit

Permalink
test(dm): fix upstream switch CI and reduce versions in upgrading CI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Aug 3, 2022
1 parent 0ad449d commit 16ca2e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upgrade_dm_via_tiup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
fail-fast: false
matrix:
previous_v2:
["v2.0.0", "v2.0.1", "v2.0.3", "v2.0.4", "v2.0.5", "v2.0.6", "v2.0.7", "v5.3.0"]
["v2.0.1", "v2.0.7", "v5.3.0"]

steps:
- name: Set up Go 1.18
Expand Down
11 changes: 10 additions & 1 deletion dm/syncer/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,16 @@ func (cp *RemoteCheckPoint) Snapshot(isSyncFlush bool) *SnapshotInfo {
}
}

flushGlobalPoint := cp.globalPoint.outOfDate() || cp.globalPointSaveTime.IsZero() || (isSyncFlush && cp.needFlushSafeModeExitPoint.Load())
// flush when
// - global checkpoint is forwarded
// - global checkpoint is not forwarded but binlog filename updated. This may happen when upstream switched or relay
// enable/disable in GTID replication
// - the first time to flush checkpoint
// - need update safe mode exit point
flushGlobalPoint := cp.globalPoint.outOfDate() ||
cp.globalPoint.savedPoint.location.Position.Name != cp.globalPoint.flushedPoint.location.Position.Name ||
cp.globalPointSaveTime.IsZero() ||
(isSyncFlush && cp.needFlushSafeModeExitPoint.Load())

// if there is no change on both table points and global point, just return an empty snapshot
if len(tableCheckPoints) == 0 && !flushGlobalPoint {
Expand Down

0 comments on commit 16ca2e3

Please sign in to comment.