-
Notifications
You must be signed in to change notification settings - Fork 47
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: Duplicated switchover event. #850
Conversation
c128a9e
to
a8ea779
Compare
a8ea779
to
b6ae7aa
Compare
b6ae7aa
to
7e45d9e
Compare
7e45d9e
to
82cadc2
Compare
82cadc2
to
f42c545
Compare
@oliviarla @namsic |
f42c545
to
c3da12c
Compare
c3da12c
to
5da0253
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@namsic ๋์ ์ ์ํด์ฃผ์ ์๊ฒฌ์ด ๋๋ฌด ๊ทน๋จ์ ์ด๋ผ ํ์ํ์ง ์๋ค๋ผ๋ ๋๋์ ์ฝ๋ฉํธ๋ ์๋๋๊น ์คํด๋ ํ์ง ๋ง์์ฃผ์๊ณ , ์ด๋ ๊ฒ ์ด์ผ๊ธฐํ ๊ฐ์ฅ ํฐ ์ด์ ๋ ๊ทน๋จ์ ์ธ case๋ค์ ๋ํด ๋ ผ์ ๋๋ฌธ์ ์๋ ์กด์ฌํ๋ PR์ ๋ชฉ์ ์ ์๋ ๊ฒฝ์ฐ๊ฐ ์ฆ์์ ๋ง์๋๋ ธ์ต๋๋ค.
๋์ผํ ๊ทธ๋ฃน์ ๋ํด ์ ์๋๋ฆฌ์ค์์ alreadySwitched๋ ์๋์ ๊ฐ์ด ์ฒ๋ฆฌ๋ฉ๋๋ค. 1. cache list ์กฐํ ์ 1์ฐจ, 2์ฐจ swtichover ๋ชจ๋ ์กฐํ ํ๋ ๊ฒฝ์ฐ
2. zk ์ด๋ฒคํธ ๋ฐ์ ํ cache list ์กฐํ ์ 2์ฐจ swtichover ํ์ ์กฐํ(๋ง์ํ์ ๊ฒฝ์ฐ)
๋ง์ํ์ ๊ฒฝ์ฐ๋ eventually ํ์์ด ํต์ผ๋๊ณ flag ๊ฐ๋ false๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค. |
5da0253
to
a72fd22
Compare
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.
์ ๊ฐ ์ดํดํ ๋๋ก ์ ๋ฆฌํ๋ฉด,
- switchover ์ด์ ํ์์ผ๋ก ๋๋์๊ฐ๋ ๊ฒฝ์ฐ๊ฐ ์ฌ์ ํ ์์ ์ ์๊ณ
- AlreadySwitched flag๊ฐ ์ ๋ ์ด๊ธฐํ๋์ง ์์ ์ ์์ง๋ง
- ์์ ๊ฐ์ ์๋๋ฆฌ์ค๋ ์ฌ๋ฌ ๊ทน๋จ์ ์ํฉ์ด ๊ฒน์น๋ ์ฝ๋ ์ผ์ด์ค์ ํด๋นํ์ฌ ์ค์ ์ด์ ํ๊ฒฝ์์ ๋ฐ์ ๊ฐ๋ฅ์ฑ์ด ์์ฃผ ์์ต๋๋ค.
- ๋ํ ๊ทธ ๊ฒฝ์ฐ์๋ ZK event๋ฅผ ๋ ์์ ํ๋ค ๋ณด๋ฉด ์ธ์ ๊ฐ๋ ์ต์ ํ์์ผ๋ก ์ ์ดํ๊ฒ ๋ฉ๋๋ค.
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.
์ต์ข ๋ฆฌ๋ทฐ ์๋ฃ์ ๋๋ค.
a72fd22
to
d63ed2e
Compare
d63ed2e
to
b6a01ad
Compare
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.
๋ฆฌ๋ทฐ ์๋ฃ
// old ํ์์ด ๋ค์ด์จ ๊ฒฝ์ฐ flag ์๋ณต skip -> ์ถํ ์์ ์ ์๋ณต ์ํฌ ์ ์๋ ์ด๋ฒคํธ ๋ฌด์กฐ๊ฑด ๋ฐ์ | ||
// newMaster๊ฐ null์ด๋๋ผ๋, ์ถํ ์์ ์ ์ ์์ ์ธ ์ด๋ฒคํธ ๋ฐ์์ผ๋ก flag ์๋ณต | ||
continue; | ||
} |
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.
์ผ์คํ์์ switchover ์ํํ ๋ ์บ์ ๋
ธ๋๋ ๊ทธ๋๋ก ์กด์ฌํ๊ณ
๋๋จธ์ง 1๊ฐ slave ๋
ธ๋๊ฐ ๋ค์ด๋ ๊ฒฝ์ฐ, changed group์ผ๋ก ํ๋ณ๋ฉ๋๋ค.
์ด ๊ฒฝ์ฐ, ๋ค์ด๋ slave ๋
ธ๋๋ฅผ ์ ๊ฑฐํ๋ฉด์๋
switchover๋ฅผ ์๋ณตํ์ง ์๋์?
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.
์ด ๋ถ๋ถ์ ์ฝ๋๋ก ํ์ธํ ์ ์๋ ๋ถ๋ถ์
๋๋ค.
์ด์์๊ฐ ์ ๋ง๋ก ์ผ์คํ๋ฅผ ์ด์คํ๋ก ๋ณ๊ฒฝํ๊ณ ์ถ์ด์ ์ค์์น์ค๋ฒ ์ํ ํ ์ฌ๋ ์ด๋ธ๋ฅผ ํ๋ ๋ด๋ฆฐ ๊ฒ์ธ์ง, ์ค์์น์ค๋ฒ ์งํ์ ์ฌ๋ ์ด๋ธ ํ๋์ ์ฅ์ ๊ฐ ๋ฐ์ํ ๊ฒ์ธ์ง ์ ์ ์์ต๋๋ค.
if (newAddrMap.remove(repl.toString()) == null) { // removed node | ||
changedGroupSet.add(oldGroup.getGroupName()); | ||
} | ||
} |
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.
์ ์ฒด์ ์ผ๋ก ๋ณต์กํ ๊ตฌํ์ธ ๋ฐ, ๋ ๋จ์ํ ๊ตฌํ์ ์๋ ์ง ?
๋ณ๋์ ํด๊ฒฐ๋ฐฉ์์ผ๋ก ์ฒ๋ฆฌ์ค์ด๊ธฐ์ closeํ๊ฒ ์ต๋๋ค. |
๐ Related Issue
โจ๏ธ What I did
findChangedGroups ๋ก์ง์์ swichover์ old ํ์์ผ๋ก ๋๋๋ฆฌ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
๋ก์ง์ ๋๋ต ์๋์ ๊ฐ์ด ๊ตฌํ๋์ด์์ต๋๋ค.
์ฐ์ ๋ฆฌ๋ทฐ๋ฅผ ์ํด ํ๊ธ๋ก ์ฃผ์์ ๋ฌ์๋์์ต๋๋ค.
์ถํ ๋ฆฌ๋ทฐ ์๋ฃ๋๋ฉด ์ ๊ฑฐ ๋๋ ์์ด๋ก ๋ณ๊ฒฝํ ์์ ์ ๋๋ค.