arcus-java-client
arcus-java-client copied to clipboard
INTERNAL: Not to cancel operations when node is removed from ZK but still alive.
๐ Related Issue
- https://github.com/jam2in/arcus-works/issues/535
โจ๏ธ What I did
- NodeLocator์์ ๋ ธ๋๋ฅผ ์ ๊ฑฐํ ๋, ํด๋น ๋ ธ๋์์ ์์ผ ์ฐ๊ฒฐ์ด ํด์ ๋์ง ์์๊ณ Operation Queue๊ฐ ๋น์ด ์์ง ์์ผ๋ฉด ์์ผ ์ฐ๊ฒฐ์ ํด์ ์ ์ฐ์ฐ ์บ์ฌ์ ์ํํ์ง ์๊ณ DelayedClosingNodes๋ก ๋ถ๋ฅํฉ๋๋ค.
- IO Thread๊ฐ DelayedClosingNodes๋ก ๋ถ๋ฅ๋ ๋
ธ๋๋ค์ ์ํํ๋ฉฐ ๋ค์์ ๋ก์ง์ ์ํํฉ๋๋ค.
- ์์ผ ์ฐ๊ฒฐ์ด ๋์ด์ง ๋ ธ๋๊ฐ ์๋ค๋ฉด ์ฐ์ฐ์ ๋ชจ๋ ์บ์ฌํ๊ณ DelayedClosingNodes์์ ์ ๊ฑฐํฉ๋๋ค.
- Operation Queue๊ฐ ๋น์ด ์๋ ๋ ธ๋๊ฐ ์๋ค๋ฉด ์์ผ ์ฐ๊ฒฐ์ ํด์ ํ๊ณ DelayedClosingNodes์์ ์ ๊ฑฐํฉ๋๋ค.
handleNodesToRemove ๋ฉ์๋๊ฐ ๋ณต์ ์ ๋ง์ด๊ทธ๋ ์ด์ ์์๋ ์ฌ์ฉ๋๋๋ฐ, ํด๋น ๋ถ๋ถ์๋ ์ํฅ์ด ์๋์?
EE์ฌ๋ cache_list znode๊ฐ ์ ๊ฑฐ๋์์ ๋ ๋์์ CE์ ๋์ผํฉ๋๋ค. alter_list znode๊ฐ ์ ๊ฑฐ๋์์ ๋๋ NodeLocator์์ ์์ผ ์ฐ๊ฒฐ์ ํด์ ํ๋ฏ๋ก ์ํฅ์ด ์์ต๋๋ค.
์ฒซ๋ฒ์งธ ์ฝ๋ฉํธ์ ์ปค๋ฐ ์์ ์ฌํญ์ ์ ๋ฐ์ดํธ ํ์ต๋๋ค.
@oliviarla @brido4125 ๋จผ์ ๋ฆฌ๋ทฐ ํ์์ฃ .
https://github.com/jam2in/arcus-works/issues/549
ํ์ฌ PR์์๋ locator์ update์ handleDelayedClosingNodes ๋ชจ๋ IO ์ฐ๋ ๋์์ ์์ฐจ์ ์ผ๋ก ์ํํฉ๋๋ค.
๋ง์ฝ, ํ์ฌ ์งํ์ค์ธ ์ด์์ฒ๋ผ locator์ ๋ํ update ์ํ์ ๋ค๋ฅธ ์ค๋ ๋๊ฐ ์ํํ ๊ฒฝ์ฐ ํด๋น ๊ตฌํ๋ ๋ณ๊ฒฝ์ด ํ์ํ ์๋ ์์ต๋๋ค.
์ถํ ์ฐธ๊ณ ํ ๋ชฉ์ ์ผ๋ก ํด๋น ์ฝ๋ฉํธ ๋จ๊น๋๋ค.