Skip to content
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: Handling abnormal swithover from zk. #867

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

brido4125
Copy link
Collaborator

@brido4125 brido4125 commented Jan 8, 2025

๐Ÿ”— Related Issue

์บ์‹œ ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ์˜ ์‘๋‹ต์„ ํ†ตํ•ด master candidate๋ฅผ ์„ค์ •ํ•˜๊ณ  ๋‚œ ๋’ค,
zk๋กœ๋ถ€ํ„ฐ ๋น„์ •์ƒ์ ์ธ switchover๋ฅผ ๊ฐ์ง€ํ•˜๋Š” ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ์ด๋‹ค.

์ด์ค‘ํ™”

์ƒํƒœ ROLE1 ROLE2 ์ฒ˜๋ฆฌ๋กœ์ง
์ดˆ๊ธฐ์ƒํƒœ M S
SwitchOver ์‘๋‹ต ํ›„ ์ƒํƒœ M S(masterCandidate)
์ •์ƒ ์ƒํƒœ (1st ZK ๋ณ€๊ฒฝ) S S Invalid Group ์ฒ˜๋ฆฌ
์ •์ƒ ์ƒํƒœ (2nd ZK ๋ณ€๊ฒฝ) S M switch-over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ1 X M Fail-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ2 M X ์ฒ˜๋ฆฌํ•„์š”
๋น„์ •์ƒ3 X X ๊ทธ๋ฃน ์ œ๊ฑฐ(๊ธฐ์กด ๋กœ์ง์ด ์ฒ˜๋ฆฌ)

์‚ผ์ค‘ํ™”

์ƒํƒœ ROLE1 ROLE2 ROLE3 ์ฒ˜๋ฆฌ๋กœ์ง
์ดˆ๊ธฐ์ƒํƒœ M S1 S2
SwitchOver ์‘๋‹ต ํ›„ ์ƒํƒœ M S1(masterCandidate) S2
์ •์ƒ ์ƒํƒœ (1st ZK ๋ณ€๊ฒฝ) S3 S1 S2 Invalid Group ์ฒ˜๋ฆฌ
์ •์ƒ ์ƒํƒœ (2nd ZK ๋ณ€๊ฒฝ) S3 M S2 switch-over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ1 S3 M X Switch-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ2 X M S2 Fail-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ3 S3 X M ์ฒ˜๋ฆฌํ•„์š”
๋น„์ •์ƒ4 X M X Fail-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ5 X X M Fail-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ
๋น„์ •์ƒ6 M X X ์ฒ˜๋ฆฌํ•„์š”
๋น„์ •์ƒ7 X X X ๊ทธ๋ฃน ์ œ๊ฑฐ(๊ธฐ์กด ๋กœ์ง์ด ์ฒ˜๋ฆฌ)

์ฐธ๊ณ ๋กœ ์•„๋ž˜์™€ ๊ฐ™์€ ์ผ€์ด์Šค๋“ค์€ zk ์‹œํ€€์Šค ๋„˜๋ฒ„์— ์˜ํ•œ
Repl Role ์„ ์ • ๋ฐฉ์‹์— ์˜ํ•ด ๋ฐœ์ƒ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

ROLE1 ROLE2 ROLE3
M X S

์œ„ ํ‘œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ๋ฐœ์ƒ ๊ฐ€๋Šฅํ•œ ๋น„์ •์ƒ ๊ฒฝ์šฐ๋“ค์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

์ด์ค‘ํ™”

  • M S : ์ดˆ๊ธฐ ์ƒํƒœ
  • M S(master-candidate) : ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์€ ํ›„ ์ƒํƒœ
  • M X : new Master๊ฐ€ ๋  ๋…ธ๋“œ๊ฐ€ ๋–จ์–ด์ง€๊ณ  old Master๊ฐ€ newMaster์ธ ์ƒํƒœ - ๋น„์ •์ƒ
  • S M : ์ •์ƒ์ ์ธ ๊ฒฝ์šฐ

์‚ผ์ค‘ํ™”

์•„๋ž˜ ์ผ€์ด์Šค์™€ ํ•จ๊ป˜ ์ด์ค‘ํ™”์˜ ๋น„์ •์ƒ ์ผ€์ด์Šค์ฒ˜๋Ÿผ
old Master๊ฐ€ newMaster์ด๊ณ  slave๊ฐ€ ๋ชจ๋‘ ๋–จ์–ด์ง„ ์ผ€์ด์Šค

  • M S1 S2: ์ดˆ๊ธฐ ์ƒํƒœ
  • M S1(master-candidate) S2: ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์€ ํ›„ ์ƒํƒœ
  • S X M : new Master๊ฐ€ ๋  ๋…ธ๋“œ๊ฐ€ ๋–จ์–ด์ง€๊ณ  2๋ฒˆ Slave๊ฐ€ ์ƒˆ๋กœ์šด New master๊ฐ€ ๋œ ์ƒํƒœ - ๋น„์ •์ƒ
  • S M S : ์ •์ƒ์ ์ธ ๊ฒฝ์šฐ

โŒจ๏ธ What I did

๋น„์ •์ƒ ์ด์ค‘ํ™”์ธ ๊ฒฝ์šฐ๋Š” oldMaster์™€ newMaster๊ฐ€ ๋™์ผํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์•„๋ž˜ ๋กœ์ง์„ ๋”ฐ๋ฅธ๋‹ค.

if (oldMasterAddr.isSameAddress(newMasterAddr)) {

๋น„์ •์ƒ ์‚ผ์ค‘ํ™”์ธ ๊ฒฝ์šฐ๋Š” oldSlaves ๋‚ด์— newMaster๊ฐ€ ์žˆ๊ณ 
newSlaves ๋‚ด์— oldMaster๊ฐ€ ์กด์žฌํ•˜๊ธฐ์— ๊ธฐ์กด์˜ Switchover ๋กœ์ง์„ ๋”ฐ๋ฅธ๋‹ค.

} else if (oldSlaveAddrs.contains(newMasterAddr)) {
if (newSlaveAddrs.contains(oldMasterAddr)) {

๋‘ ๊ฒฝ์šฐ ๋ชจ๋‘ cache server ์‘๋‹ต์— ์˜ํ•ด ์„ค์ •๋œ
master candidate์— ์Œ“์ธ ops ๊ฐ์ฒด๋“ค์„ oldmaster๋กœ ์˜ฎ๊ฒจ์ค˜์•ผํ•œ๋‹ค.

์ด์ค‘ํ™”์˜ ๊ฒฝ์šฐ master candidate๋ฅผ null๋กœ ์„ค์ •ํ•ด์„œ master๋กœ op๊ฐ€ ์ฒ˜๋ฆฌ๋˜๋„๋ก ํ•œ๋‹ค.

์‚ผ์ค‘ํ™”๋Š” zk๋กœ๋ถ€ํ„ฐ ๋ฐ›์€ master๋ฅผ ์„ค์ •ํ•˜์—ฌ
์ตœ์‹  master์— op๊ฐ€ ์ฒ˜๋ฆฌ๋˜๋„๋ก ํ•œ๋‹ค.

@brido4125 brido4125 force-pushed the fix/abnormalSwithcover branch from 1286a78 to 0e988d2 Compare January 8, 2025 08:14
@jhpark816
Copy link
Collaborator

@brido4125
๋ฆฌ๋ทฐ์–ด๊ฐ€ PR ์„ค๋ช…์„ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ์ง€๋ฅผ ํ™•์ธํ•˜๊ณ 
์ดํ•ด๊ฐ€ ์–ด๋ ต๋‹ค๋ฉด, ๋จผ์ € ์„ค๋ช…ํ•˜๊ณ  ๋ฆฌ๋ทฐํ•˜๋Š” ๊ฒƒ์ด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

@jhpark816 jhpark816 requested review from uhm0311 and oliviarla January 8, 2025 08:49
@brido4125
Copy link
Collaborator Author

@uhm0311 @oliviarla

ํ˜น์‹œ ์˜คํ”„๋ผ์ธ ์„ค๋ช…์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ํŽธํ•˜๊ฒŒ ๋งํ•ด์ฃผ์„ธ์š”

@uhm0311
Copy link
Collaborator

uhm0311 commented Jan 9, 2025

์„ค๋ช… ํ•œ ๋ฒˆ ํ•ด์ฃผ์„ธ์š”.
๋‚ด์ผ ํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

@brido4125 brido4125 marked this pull request as draft January 16, 2025 05:46
@brido4125 brido4125 self-assigned this Jan 16, 2025
@brido4125 brido4125 marked this pull request as ready for review January 16, 2025 07:52
@brido4125
Copy link
Collaborator Author

@uhm0311 @oliviarla

PR ์ฝ”๋ฉ˜ํŠธ ์—…๋ฐ์ดํŠธ ํ–ˆ์Šต๋‹ˆ๋‹ค.

@brido4125 brido4125 marked this pull request as draft January 17, 2025 01:28
@brido4125 brido4125 force-pushed the fix/abnormalSwithcover branch from 0e988d2 to 4657886 Compare January 17, 2025 02:02
@brido4125 brido4125 marked this pull request as ready for review January 17, 2025 02:16
@brido4125 brido4125 force-pushed the fix/abnormalSwithcover branch from 4657886 to ce2f9fc Compare January 17, 2025 02:18
uhm0311
uhm0311 previously approved these changes Jan 17, 2025
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ ์™„๋ฃŒ

๋‹ค๋ฅธ ๊ฒฝ์šฐ๋„ ํ™•์ธํ•˜์—ฌ ์•ˆ์ „ํ•œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•ฉ์‹œ๋‹ค.

src/main/java/net/spy/memcached/MemcachedConnection.java Outdated Show resolved Hide resolved
@brido4125 brido4125 force-pushed the fix/abnormalSwithcover branch from ce2f9fc to 542c8c4 Compare January 20, 2025 05:39
@brido4125 brido4125 marked this pull request as draft January 20, 2025 05:45
@brido4125 brido4125 marked this pull request as ready for review January 20, 2025 05:46
@jhpark816
Copy link
Collaborator

@brido4125

๋‹ค๋ฅธ ๊ฒฝ์šฐ๋„ ํ™•์ธํ•˜์—ฌ ์•ˆ์ „ํ•œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•ฉ์‹œ๋‹ค.

์œ„์˜ ์ฝ”๋ฉ˜ํŠธ์— ๋Œ€ํ•ด์„œ๋„ ๊ฒ€ํ† ๊ฐ€ ๋˜์—ˆ๋‚˜์š”?

@brido4125 brido4125 force-pushed the fix/abnormalSwithcover branch from 542c8c4 to 3cad10c Compare January 21, 2025 06:53
@brido4125 brido4125 requested a review from jhpark816 January 21, 2025 07:01
@jhpark816
Copy link
Collaborator

@uhm0311 @oliviarla
๋ฆฌ๋ทฐ ๋‹ค์‹œ ์ง„ํ–‰ํ•ด ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

@uhm0311 ๋น ๋ฅธ ๋ฆฌ๋ทฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

@uhm0311
Copy link
Collaborator

uhm0311 commented Jan 23, 2025

์ฝ”๋“œ๊ฐ€ ๋งŽ์ด ๊ฐ„๋žตํ™”๋˜์—ˆ๋Š”๋ฐ, ๊ฐ ๊ฒฝ์šฐ๋ฅผ ์–ด๋–ค ์›๋ฆฌ๋กœ ์ปค๋ฒ„ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์„ค๋ช…ํ•ด์ฃผ์—ˆ์œผ๋ฉด ํ•ฉ๋‹ˆ๋‹ค.

@@ -485,13 +485,32 @@ private void updateReplConnections(List<InetSocketAddress> addrs) throws IOExcep
// move operation slave -> master.
taskList.add(new MoveOperationTask(
oldSlaveNode, oldMasterNode, false));
// clear the masterCandidate if the removed slave is the masterCandidate.
if (oldGroup.getMasterCandidate() == oldSlaveNode) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oldMaster์™€ newMaster๊ฐ€ ๋™์ผํ•˜๊ณ 
oldSlave๋“ค ์ค‘ masterCandidate๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ
์ด๋ฅผ clear ํ•˜์—ฌ null๋กœ ์„ค์ •์‹œ์ผœ ์ค๋‹ˆ๋‹ค.

PR ์ฝ”๋ฉ˜ํŠธ์˜ (M,X)์™€ (M,X,X) ์ธ ๊ฒฝ์šฐ๋ฅผ ์ฒ˜๋ฆฌ์‹œ์ผœ์ค๋‹ˆ๋‹ค.

์ด ๊ฒฝ์šฐ๋กœ ๋ณ€๊ฒฝ๋œ ์ด์œ ๋Š” ์•„๋ž˜ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.
#867 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ทธ๋Ÿผ ๊ทธ ์ดํ›„์˜ ์ฒ˜๋ฆฌ๋Š” ์–ด๋–ป๊ฒŒ ๋˜๋‚˜์š”?

  • M S1 S2 ์ƒํƒœ์—์„œ M์—๊ฒŒ ๋‹ค์‹œ SWITCHOVER ์‘๋‹ต์„ ๋ฐ›์€ ๊ฒฝ์šฐ
  • M S1 S2 ์ƒํƒœ์—์„œ ZK๋กœ๋ถ€ํ„ฐ S1 M S2๋ฅผ ๋ฐ›์€ ๊ฒฝ์šฐ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋‹ค๋ฅธ ๊ทธ๋ฃน์˜ ๋ณ€๊ฒฝ์— ์˜ํ•ด M S1 S2 ์ƒํƒœ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ
ํ˜„์žฌ ๋กœ์ง์€ changedGroup์— ์ถ”๊ฐ€๋˜์ง€ ์•Š์•„์„œ
๋ณ€๊ฒฝ์ด ์ƒ๊ธฐ์ง€ ์•Š์€ ๊ทธ๋ฃน์€ ์•„๋ฌด๋Ÿฐ ๋กœ์ง์„ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

M S1 S2 ์ƒํƒœ์—์„œ M์—๊ฒŒ ๋‹ค์‹œ SWITCHOVER ์‘๋‹ต์„ ๋ฐ›์€ ๊ฒฝ์šฐ

์ด๋ฏธ masterCandidate๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š” ์ƒํƒœ๋ผ์„œ ์žฌ์„ค์ • ํ•˜์ง€ ์•Š๊ณ 
swtichover ์ž‘์—…์ด ์ง„ํ–‰ ์˜ˆ์ •

M S1 S2 ์ƒํƒœ์—์„œ ZK๋กœ๋ถ€ํ„ฐ S1 M S2๋ฅผ ๋ฐ›์€ ๊ฒฝ์šฐ

์ •์ƒ์ ์ธ switchover ๋กœ์ง ์ˆ˜ํ–‰

์ €๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ดํ•ดํ–ˆ๋Š”๋ฐ ํ˜น์‹œ ์•„๋‹ˆ๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”

SWITCHOVER ์‘๋‹ต -> ๋‹ค๋ฅธ ๊ทธ๋ฃน์˜ ๋ณ€๊ฒฝ์— ์˜ํ•ด ๋™์ผํ•œ ํ˜•์ƒ(M S1 S2) zk ์ด๋ฒคํŠธ ๋ฐœ์ƒ -> ๋‹ค์‹œ SWITCHOVER ์‘๋‹ต or (S1 M S2) Switchover ์ด๋ฒคํŠธ ๋ฐœ์ƒ

Copy link
Collaborator

@uhm0311 uhm0311 Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ดํ•ดํ–ˆ๋Š”๋ฐ ํ˜น์‹œ ์•„๋‹ˆ๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”

๋งž์Šต๋‹ˆ๋‹ค.


ํ˜„์žฌ ๋กœ์ง์€ changedGroup์— ์ถ”๊ฐ€๋˜์ง€ ์•Š์•„์„œ
๋ณ€๊ฒฝ์ด ์ƒ๊ธฐ์ง€ ์•Š์€ ๊ทธ๋ฃน์€ ์•„๋ฌด๋Ÿฐ ๋กœ์ง์„ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

#867 (comment)

์ด ์ฝ”๋ฉ˜ํŠธ์—๋Š” changedGroup์„ ๊ตฌํ•˜๋Š” ๋กœ์ง์ด ์ œ๊ฑฐ๋˜๋Š” ๊ฒƒ๋„ ์—ผ๋‘ํ•  ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€๋Š”๋ฐ ๋‹น์žฅ์€ ์—ผ๋‘ํ•˜์ง€ ์•Š๋Š” ๊ฑด๊ฐ€์š”?


์ด๋ฏธ masterCandidate๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š” ์ƒํƒœ๋ผ์„œ ์žฌ์„ค์ • ํ•˜์ง€ ์•Š๊ณ 
swtichover ์ž‘์—…์ด ์ง„ํ–‰ ์˜ˆ์ •

490๋ผ์ธ์—์„œ๋Š” clearMasterCandidate() ๋ฉ”์†Œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋Š”๋ฐ, ์ดํ›„์— ์–ธ์ œ ์–ด๋””์—์„œ masterCandidate๊ฐ€ ๋‹ค์‹œ ์„ค์ •๋˜๋‚˜์š”?


์ •์ƒ์ ์ธ switchover ๋กœ์ง ์ˆ˜ํ–‰

Delayed switchover ์ธ๊ฐ€์š”? ํ˜น์€ ์ฆ‰์‹œ switchover ์ธ๊ฐ€์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ์ฝ”๋ฉ˜ํŠธ์—๋Š” changedGroup์„ ๊ตฌํ•˜๋Š” ๋กœ์ง์ด ์ œ๊ฑฐ๋˜๋Š” ๊ฒƒ๋„ ์—ผ๋‘ํ•  ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€๋Š”๋ฐ ๋‹น์žฅ์€ ์—ผ๋‘ํ•˜์ง€ ์•Š๋Š” ๊ฑด๊ฐ€์š”?

๋„ต, ์—ผ๋‘ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด 490๋ผ์ธ์ด ํ˜ธ์ถœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
์šฐ์„ ์€ ์—ผ๋‘ํ•˜์ง€ ์•Š๊ณ  ์ถ”ํ›„์— changedGroup์„ ๋ฆฌํŒฉํ† ๋งํ• ๋•Œ ๊ณ ๋ คํ•  ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค.

Delayed switchover ์ธ๊ฐ€์š”? ํ˜น์€ ์ฆ‰์‹œ switchover ์ธ๊ฐ€์š”?

์„œ๋ฒ„ ์‘๋‹ต์„ ์ด๋ฏธ ๋ฐ›์•˜๊ธฐ ๋•Œ๋ฌธ์— ์ฆ‰์‹œ swtichover ์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator

@uhm0311 uhm0311 Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์„œ๋ฒ„ ์‘๋‹ต์„ ์ด๋ฏธ ๋ฐ›์•˜๊ธฐ ๋•Œ๋ฌธ์— ์ฆ‰์‹œ swtichover ์ž…๋‹ˆ๋‹ค.

ZK๋กœ๋ถ€ํ„ฐ ์ƒˆ๋กœ์šด ์บ์‹œ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ฐ›์•˜์„ ๋•Œ ์ด๋ฏธ ์บ์‹œ ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์€ ๊ฒฝ์šฐ์™€ ๋ฐ›์ง€ ์•Š์€ ๊ฒฝ์šฐ๋กœ ๋‚˜๋‰˜๊ฒŒ ๋˜๋Š”๋ฐ์š”.
์ด๋ฏธ ์บ์‹œ ์„œ๋ฒ„ ์‘๋‹ต์„ ๋ฐ›์€ ๊ฒฝ์šฐ์—๋Š” ์ฆ‰์‹œ swtichover์ผ ๊ฒƒ์ด๊ณ , ์บ์‹œ ์„œ๋ฒ„ ์‘๋‹ต์„ ์•„์ง ๋ฐ›์ง€ ์•Š๊ณ  ZK์˜ ์บ์‹œ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋จผ์ € ๋ฐ›์€ ๊ฒฝ์šฐ์—๋Š” ๊ธฐ์กด์˜ Delayed switchover์œผ๋กœ ์ถฉ๋ถ„ํžˆ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜๋‚˜์š”?


์ด๋ฏธ masterCandidate๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š” ์ƒํƒœ๋ผ์„œ ์žฌ์„ค์ • ํ•˜์ง€ ์•Š๊ณ 
swtichover ์ž‘์—…์ด ์ง„ํ–‰ ์˜ˆ์ •

490๋ผ์ธ์—์„œ๋Š” clearMasterCandidate() ๋ฉ”์†Œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋Š”๋ฐ, ์ดํ›„์— ์–ธ์ œ ์–ด๋””์—์„œ masterCandidate๊ฐ€ ๋‹ค์‹œ ์„ค์ •๋˜๋‚˜์š”?

์ด ๋ถ€๋ถ„๋„ ์งˆ๋ฌธํ–ˆ๋Š”๋ฐ, ๋ชป๋ณด๊ณ  ์ง€๋‚˜์นœ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์˜คํ”„๋ผ์ธ์œผ๋กœ ๋ง์”€ํ•ด์ฃผ์‹  ๊ถ๊ธˆํ•œ ์ผ€์ด์Šค์— ๋Œ€ํ•œ ๋‹ต๋ณ€์ž…๋‹ˆ๋‹ค.
์•„๋ž˜ ์ฝ”๋ฉ˜ํŠธ์˜ 2๋ฒˆ ๊ฒฝ์šฐ์—์„œ๋Š” masterCandidate๊ฐ€ clear ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
์™œ๋ƒํ•˜๋ฉด ํ•ด๋‹น oldSlave๋Š” newSlaves์— ํฌํ•จ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

#867 (comment)

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋ถ€ ๋ฆฌ๋ทฐ

oldGroup.setMasterCandidateByAddr(newMasterAddr.getIPPort());
taskList.add(new MoveOperationTask(
oldMasterCandidate, oldGroup.getMasterCandidate(), false));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brido4125
์•„๋ž˜ ๊ฒฝ์šฐ์—์„œ masterCandidate ์„ค์ •์€ clear๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์ด์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๊ฐ€ ์žˆ๋Š” ์ง€๋ฅผ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.

์ƒํƒœ ROLE1 ROLE2 ROLE3 ์ฒ˜๋ฆฌ๋กœ์ง
์ดˆ๊ธฐ์ƒํƒœ M S1 S2
SwitchOver ์‘๋‹ต ํ›„ ์ƒํƒœ M S1(masterCandidate) S2
๋น„์ •์ƒ5 X X M Fail-Over ๋กœ์ง์ด ์ฒ˜๋ฆฌ

changeRoleGroups.add(oldGroup);
if (!newMasterAddr.isSameAddress(
((ArcusReplNodeAddress) oldMasterCandidate.getSocketAddress()))) {
Copy link
Collaborator

@jhpark816 jhpark816 Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„๋ž˜ ํ˜•ํƒœ๋กœ ๋น„๊ตํ•ด๋„ ๋˜์ง€ ์•Š๋‚˜์š”?

if (oldMasterCandidate != newMasterAddr) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants