-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: for auto-failover, correct master-slave replication relationship automatically after master or slave pika restarted (#2373, #2038, #1950,#1967,#2351) #2386
Conversation
55e45c1
to
4771a7d
Compare
codis/pkg/topom/topom_group.go
Outdated
return requestSetNewRedisMaster(serverAddr, "NO:ONE", auth, false) | ||
} | ||
|
||
func updateMasterToNewOneForce(serverAddr, masterAddr string, auth string) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forcefully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
codis/pkg/topom/topom_group.go
Outdated
return requestSetNewRedisMaster(serverAddr, masterAddr, auth, true) | ||
} | ||
|
||
func requestSetNewRedisMaster(serverAddr, masterAddr string, auth string, force bool) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setNewRedisMaster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
codis/pkg/topom/topom_group.go
Outdated
} | ||
g.Servers[index].Action.State = state | ||
// recheck offline status through heartbeat and automatically repair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check whether the master is offline through heartbeat, if so, select a new master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
codis/pkg/topom/topom_sentinel.go
Outdated
for _, state := range states { | ||
var g *models.Group | ||
if g, err = ctx.getGroup(state.GroupID); err != nil { | ||
var group *models.Group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
挪到for循环外
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
codis/pkg/utils/redis/client_test.go
Outdated
slave_read_only:1 | ||
db0:binlog_offset=1 284,safety_purge=none | ||
` | ||
ir, err := parseInfoReplication(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
codis/pkg/utils/redis/sentinel.go
Outdated
return "" | ||
} | ||
|
||
return i.MasterHost + ":" + i.MasterPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joinhost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* fix: codis-dashboard uses 100% cpu(#2332) (#2393) Co-authored-by: liuchengyu <[email protected]> * fix: The role displayed on the first Server in the Group area of the codis-fe is incorrect (#2350) (#2387) Co-authored-by: liuchengyu <[email protected]> * fix: automatic fix master-slave replication relationship after master or slave service restarted (#2373, #2038, #1950, #1967, #2351)) (#2386) Co-authored-by: liuchengyu <[email protected]> * feat:add 3.5.3 changelog (#2395) * add 3.5.3 changelog --------- Co-authored-by: chejinge <[email protected]> --------- Co-authored-by: Chengyu Liu <[email protected]> Co-authored-by: liuchengyu <[email protected]> Co-authored-by: chejinge <[email protected]>
… or slave service restarted (OpenAtomFoundation#2373, OpenAtomFoundation#2038, OpenAtomFoundation#1950, OpenAtomFoundation#1967, OpenAtomFoundation#2351)) (OpenAtomFoundation#2386) Co-authored-by: liuchengyu <[email protected]>
… or slave service restarted (OpenAtomFoundation#2373, OpenAtomFoundation#2038, OpenAtomFoundation#1950, OpenAtomFoundation#1967, OpenAtomFoundation#2351)) (OpenAtomFoundation#2386) Co-authored-by: liuchengyu <[email protected]>
* fix: codis-dashboard uses 100% cpu(OpenAtomFoundation#2332) (OpenAtomFoundation#2393) Co-authored-by: liuchengyu <[email protected]> * fix: The role displayed on the first Server in the Group area of the codis-fe is incorrect (OpenAtomFoundation#2350) (OpenAtomFoundation#2387) Co-authored-by: liuchengyu <[email protected]> * fix: automatic fix master-slave replication relationship after master or slave service restarted (OpenAtomFoundation#2373, OpenAtomFoundation#2038, OpenAtomFoundation#1950, OpenAtomFoundation#1967, OpenAtomFoundation#2351)) (OpenAtomFoundation#2386) Co-authored-by: liuchengyu <[email protected]> * feat:add 3.5.3 changelog (OpenAtomFoundation#2395) * add 3.5.3 changelog --------- Co-authored-by: chejinge <[email protected]> --------- Co-authored-by: Chengyu Liu <[email protected]> Co-authored-by: liuchengyu <[email protected]> Co-authored-by: chejinge <[email protected]>
fix: automatic fix master-slave replication relationship after master or slave service restarted (#2373, #2038, #1950,#1967,#2351)
the design proposal: #2367