02.Replica Failure
In-Sync Replicas ๋ฆฌ์คํธ ๊ด๋ฆฌ
Leader๊ฐ ๊ด๋ฆฌ
๋ฉ์์ง๊ฐ ISR ๋ฆฌ์คํธ์ ๋ชจ๋ Replica(๋ณต์ ๋ณธ)์์ ์์ ๋๋ฉด Commit๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผ
Kafka Cluster์ Controller๊ฐ ๋ชจ๋ํฐ๋งํ๋ ZooKeeper์ ISR ๋ฆฌ์คํธ์ ๋ํ ๋ณ๊ฒฝ ์ฌํญ์ Leader๊ฐ ์ ์ง
n๊ฐ์ Replica๊ฐ ์๋ ๊ฒฝ์ฐ n-1๊ฐ์ ์ฅ์ ๋ฅผ ํ์ฉํ ์ ์์
Follower๊ฐ ์คํจํ๋ ๊ฒฝ์ฐ
Leader์ ์ํด ISR ๋ฆฌ์คํธ์์ ์ญ์ ๋จ
Leader๋ ์๋ก์ด ISR์ ์ฌ์ฉํ์ฌ Commitํจ
Leader๊ฐ ์คํจํ๋ ๊ฒฝ์ฐ
Controller๋ Follower ์ค์์ ์๋ก์ด Leader๋ฅผ ์ ์ถ
Controller๋ ์ Leader์ ISR ์ ๋ณด๋ฅผ ๋จผ์ ZooKeeper์ Pushํ ๋ค์ ๋ก์ปฌ ์บ์ฑ์ ์ํด Broker์ Pushํจ
ISR์ Leader๊ฐ ๊ด๋ฆฌ
Zookeeper์ ISR ์ ๋ฐ์ดํธ, Controller๊ฐ Zookeeper๋ก๋ถํฐ ์์

Follower๊ฐ ๋๋ฌด ๋๋ฆฌ๋ฉด Leader๋ ISR์์ Follower๋ฅผ ์ ๊ฑฐํ๊ณ ZooKeeper์ ISR์ ์ ์ง
Controller๋ Partition Metadata์ ๋ํ ๋ณ๊ฒฝ ์ฌํญ์ ๋ํด์ Zookeeper๋ก๋ถํฐ ์์
Leader Failure
Controller๊ฐ ์๋ก์ด Leader ์ ์ถ

Controller๊ฐ ์๋ก ์ ์ถํ Leader ๋ฐ ISR ์ ๋ณด๋, Controller ์ฅ์ ๋ก๋ถํฐ ๋ณดํธํ๊ธฐ ์ํด, ZooKeeper์ ๊ธฐ๋ก๋ ๋ค์ ํด๋ผ์ด์ธํธ ๋ฉํ๋ฐ์ดํฐ ์ ๋ฐ์ดํธ๋ฅผ ์ํด ๋ชจ๋ Broker์ ์ ํ
Broker Failure
Broker 4 ๋, Partition 4, Replication Factor๊ฐ 3 ์ผ ๊ฒฝ์ฐ๋ฅผ ๊ฐ์
Partition ์์ฑ์ Broker๋ค ์ฌ์ด์์ Partition๋ค์ด ๋ถ์ฐํ์ฌ ๋ฐฐ์น๋จ

Broker 4์ ์ฅ์ ๊ฐ ๋ฐ์ํ๋ ๊ฒฝ์ฐ

Partition Leader๊ฐ ์๋ ๊ฒฝ์ฐ
Partition์ Leader๊ฐ ์์ผ๋ฉด, Leader๊ฐ ์ ์ถ๋ ๋๊น์ง ํด๋น Partition์ ์ฌ์ฉํ ์ ์๊ฒ ๋จ
Producer์ send() ๋ retries ํ๋ผ๋ฏธํฐ๊ฐ ์ค์ ๋์ด ์์ผ๋ฉด ์ฌ์๋ํจ ๋ง์ฝ retries=0 ์ด๋ฉด, NetworkException์ด ๋ฐ์ํจ
Last updated