FEATURE: Add CompletableFuture Admin APIs#1073
Open
f1v3-dev wants to merge 1 commit intonaver:developfrom
Open
FEATURE: Add CompletableFuture Admin APIs#1073f1v3-dev wants to merge 1 commit intonaver:developfrom
f1v3-dev wants to merge 1 commit intonaver:developfrom
Conversation
f1v3-dev
commented
Apr 2, 2026
Comment on lines
+1727
to
+1729
| public ArcusFuture<Boolean> flush(int delay) { | ||
| if (delay < -1) { | ||
| throw new IllegalArgumentException("Delay should be a positive integer or -1 for no delay"); |
Collaborator
Author
There was a problem hiding this comment.
flush(int delay) 의 delay 파라미터 처리 방식에 대해 논의가 필요합니다.
현재 -1을 "delay 파라미터를 생략한다"는 값으로 사용하고 있습니다.
- delay = -1 →
flush_prefix <prefix>\r\n(delay 생략, 즉시 무효화) - delay = 0 →
flush_prefix <prefix> 0\r\n(동일하게 즉시 무효화)
서버는 음수를 받지 못하지만, "사용하지 않음"을 표현하기 위해 -1을 코드 내부 규약으로 허용하고 있습니다.
delay가 없는 경우(-1)와 delay = 0인 경우 모두 서버에서 즉시 flush로 동작이 일치하는데, 이를 어떻게 처리해야 할까요?
f1v3-dev
commented
Apr 2, 2026
Comment on lines
+1826
to
+1836
| return new ArcusMultiFuture<>(futures, () -> { | ||
| for (CompletableFuture<?> future : futures) { | ||
| if (future.isCompletedExceptionally()) { | ||
| return false; | ||
| } | ||
|
|
||
| if (Boolean.TRUE.equals(future.join())) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; |
Collaborator
Author
There was a problem hiding this comment.
flush_prefix 에 대하여 아래와 같은 상황으로 논의가 필요합니다.
TO-BE는 제 생각을 기반으로 현재 구현한 방향입니다.
서버 동작
flush_prefix <prefix> 명령은 모든 캐시 노드에 브로드캐스트됩니다. 이 때, 각 노드는 독립적으로 응답하게 됩니다.
- 해당 prefix의 키가 있는 노드 →
OK - 해당 prefix의 키가 없는 노드 →
NOT_FOUND
AS-IS (v1 문제)
NOT_FOUND를 실패로 처리하여 하나라도 NOT_FOUND가 오면 false를 반환합니다.
시나리오: 노드 A, B, C 중 A에만 prefixA:key 존재
| 노드 | 서버 응답 | v1 처리 |
|---|---|---|
| A | OK |
- |
| B | NOT_FOUND |
result = false 덮어쓰기 |
| C | NOT_FOUND |
result = false 덮어쓰기 |
- 실제 동작: A의 키는 flush됨
- 반환값:
false→ prefix가 없어서 아무것도 안 됐나? 라고 사용자가 해석할 수 있음
TO-BE (v2 변경)
NOT_FOUND를 "해당 노드에 prefix 없음"으로 처리하고, 하나라도 flush가 실제로 발생했는지를 기준으로 반환값을 결정합니다.
| 상황 | v1 | v2 |
|---|---|---|
| 일부 노드에 prefix 존재 (A=OK, B/C=NOT_FOUND) | false |
true |
| 모든 노드에 prefix 없음 (A/B/C=NOT_FOUND) | false |
false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issue
⌨️ What I did
flush()/flush(int delay): flush_allflush(String prefix)/flush(String prefix, int delay): flush_prefixstats()/stats(String arg): 서버 통계 조회versions(): 서버 버전 조회