-
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
ENHANCE: Moved cache list change logic from IO thread to CacheManger thread. #649
base: develop
Are you sure you want to change the base?
Conversation
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.
9a955aa
to
139665b
Compare
This comment was marked as resolved.
This comment was marked as resolved.
139665b
to
2e197dc
Compare
2e197dc
to
bc90d78
Compare
bc90d78
to
2a4764e
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.
2a4764e
to
8b1c7c3
Compare
8b1c7c3
to
03e59cd
Compare
03e59cd
to
b7112f0
Compare
3e3a46d
to
3a75ede
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.
리뷰 완료
e2b1a9e
to
c9bd722
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.
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.
리뷰 완료
c9bd722
to
34b215f
Compare
07918e6
to
ae2a82f
Compare
34b215f
to
f20a8e5
Compare
f20a8e5
to
d3d0089
Compare
d3d0089
to
17bc9c1
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.
일부 리뷰
|
||
synchronized (this) { | ||
notifyAll(); // awake CacheManager Thread. | ||
} |
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.
closing()
메소드가 같은 일을 합니다.
wakeup()
으로 용어를 변경하고, wakeup()
호출합시다.
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.
alter_list 변경 시에는 wakeup 시키지 않나요?
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.
alter_list 변경 시에는 wakeup 시키지 않나요?
processAlterListResult 콜백에 의해 commandAlterListChange가 호출되면
MemcachedConnection.setAlterNodesChange에 의해 wakeup 됩니다.
cacheList와 alterList의 변경을 감지하는 콜백 메서드가 별도로 구성됩니다.
alterList 변경 반영의 경우 주키퍼 클라이언트의 스레드에 의해 로직이 수행됩니다.
@@ -398,6 +398,17 @@ public void run() { | |||
waitBeforeRetryMonitorCheck(1000L - elapsed); | |||
} | |||
} | |||
|
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.
아래 코멘트가 hide된 곳에 들어가서, 다시 코멘트합니다.
wait() 중에 notifyAll()에 의해 깨어나더라도 다시 wait() 하는 코드가 있습니다.
동작의 의미는 유지하면서 wait()는 한 곳에만 수행되게 해 주세요.
즉, waitBeforeRetryMonitorCheck()
메소드를 2회 호출하지 않아야 합니다.
getLogger().error("Cache List update error in ArcusClient {}, exception = {}", | ||
ac.getName(), e.getCause()); | ||
} | ||
} |
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.
중요한 논의가 필요한 부분입니다.
기존엔 각 client의 io thread가 동시에 hash ring update 진행하였지만
현재는 cache manager thread 혼자서 모든 client의 hash ring update 진행합니다. 따라서, update가 반영되는 데 있어 지연이 생길 수 있습니다.
Cache Manager에 locator 하나만을 두고 이용하는 방안을 강구할 수 있나요?
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.
이는 제가 예전에 리뷰했던 내용과 일치하며, 변경 사항이 아주 많아질 예정이기 때문에 별도의 PR로 반영한다는 대답을 들었습니다.
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.
언급되었던 사항이군요.
현재 PR이 기존 동작보다 hashring update 지연을 발생시킬 수 있어,
Single hashring 유지하는 방안이 현재 PR 범위에 포함되어야 할 것 같습니다.
Single hahsring 유지 방안을 PoC로 진행해 보는 것이 좋겠습니다.
Motivation
현재 로직에서는 IO 쓰레드가
hash ring의 update로직을 수행한다.
이를 다른 CacheManager 데몬 쓰레드에게 이관하게
IO 쓰레드의 작업량을 감소시킨다.
관련 이슈
https://github.com/jam2in/arcus-works/issues/406