Skip to content

FIX: Report live membership and response in cluster status - #64

Merged
oliviarla merged 1 commit into
developfrom
refactor/cluster-status
Nov 24, 2026
Merged

oliviarla merged 1 commit into
developfrom
refactor/cluster-status

Conversation

@f1v3-dev

@f1v3-dev f1v3-dev commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Related Issue

⌨️ What I did

  • cluster status의 상태 판단 기준을 수정합니다.
    • AS-IS: cache_server_mapping + 프로세스 조회
    • TO-BE: cache_list 노드 + 캐시 서버 version 응답
  • 실제 버전, 응답 여부, 클러스터 참여 상태와 정상 서버 수를 출력합니다.
  • Enterprise의 경우 실제 group과 role을 조회합니다.
  • 저장된 토폴로지와의 차이를 주소별 경고로 표시합니다.

AS-IS

배포 시 저장한 버전, 그룹, 역할과 프로세스 실행 여부, cache_server_mapping 등록 여부를 표시합니다. Switchover 등으로 토폴로지 형상과 실제 형상이 달라져도 출력에서 확인할 수 없습니다.

Arcus cluster "test-enterprise" (edition: enterprise, version: 0.12.1-E)

GROUP  ROLE    ADDRESS          PROCESS_STATUS  ZK_REGISTERED
g1     master  127.0.0.1:13211  running         yes
g1     slave   127.0.0.1:13212  running         yes
g2     master  127.0.0.1:13213  running         yes
g2     slave   127.0.0.1:13214  running         yes

TO-BE

노드별 실행 버전, 응답 여부, 클러스터 참여 상태를 표시합니다. 토폴로지 형상과 실제 형상을 비교하여 차이를 경고로 나타냅니다. 아래는 g2 그룹의 master와 slave가 전환된 경우입니다.

Arcus cluster "test-enterprise" (edition: enterprise)
Nodes: 4/4 healthy

GROUP  ROLE    ADDRESS          VERSION   ZK
g1     master  127.0.0.1:13211  0.12.1-E  joined
g1     slave   127.0.0.1:13212  0.12.1-E  joined
g2     slave   127.0.0.1:13213  0.12.1-E  joined
g2     master  127.0.0.1:13214  0.12.1-E  joined

Warnings:
  127.0.0.1:13213:
    - group/role differs (topology=g2/master, actual=g2/slave)
  127.0.0.1:13214:
    - group/role differs (topology=g2/slave, actual=g2/master)

@f1v3-dev f1v3-dev self-assigned this Nov 9, 2026
Comment thread internal/cluster/status.go Resolved
@claude

claude Bot commented Nov 9, 2026

Copy link
Copy Markdown

[Major]
cluster status 출력 형식 변경이 docs/2-cluster-guide.md에 반영되지 않았습니다.

문제 상황

internal/cluster/status.go가 PROCESS_STATUS/ZK_REGISTERED 컬럼과 헤더의 version: ... 표시를 제거하고, 대신 Nodes: X/Y healthy 요약, VERSION/RESPONDING/ZK 컬럼, Warnings 섹션을 출력하도록 바뀌었습니다. docs/2-cluster-guide.md의 cluster status 절(298~350행)은 여전히 이전 출력(ADDRESS PROCESS_STATUS ZK_REGISTERED, 헤더의 version: 1.16.1)과 PROCESS_STATUS/ZK_REGISTERED 의미 표를 그대로 싣고 있어 실제 명령 출력과 일치하지 않습니다. 해당 파일이 이번 PR의 diff에 포함되어 있지 않아 인라인 코멘트를 달 수 없어 여기에 남깁니다.

해결 방안

예시 출력과 상태 설명 표를 현재 구현에 맞게 갱신해 주세요 (Nodes 요약 줄, VERSION/RESPONDING/ZK 컬럼 의미, group/role 불일치나 cache_list 미등록 시 나오는 Warnings 섹션 예시 포함).


[Question]
RESPONDING 판정이 이제 arcusctl을 실행하는 운영 장비에서 캐시 서버 포트로 직접 TCP 연결(net.DialTimeout)해 확인합니다(internal/cluster/server.go의 probeCacheVersion). 기존에는 SSH로 원격 호스트에 접속해 프로세스 실행 여부를 확인했으므로 SSH 접근 권한만 있으면 충분했습니다. 운영 환경에 따라 arcusctl을 실행하는 장비가 캐시 서버 포트에 직접 접근하지 못하고 SSH(bastion)로만 접근 가능한 경우가 있다면, 캐시 서버가 정상이어도 모든 노드가 RESPONDING: no로 보고될 수 있습니다. 이 네트워크 전제가 의도된 것인지 확인 부탁드립니다.

리뷰 완료 — Blocker 0건, Major 2건, Minor 0건, Question 1건

@f1v3-dev
f1v3-dev force-pushed the refactor/cluster-status branch from 1575ce0 to 31710dd Compare November 9, 2026 05:29
@f1v3-dev

f1v3-dev commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

문서는 관련 작업(cluster status/list, zk status/list) 후 반영 예정입니다.

Comment thread internal/cluster/server.go Resolved
Comment thread internal/cluster/status_report.go Resolved
@claude

claude Bot commented Nov 9, 2026

Copy link
Copy Markdown

리뷰 완료 — Blocker 0건, Major 1건, Minor 0건, Question 1건

@f1v3-dev
f1v3-dev force-pushed the refactor/cluster-status branch from 31710dd to 7545d22 Compare November 9, 2026 05:50
@f1v3-dev
f1v3-dev requested review from namsic and oliviarla November 9, 2026 05:56
@f1v3-dev

f1v3-dev commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

업그레이드 진행 및 실패 단계를 추가는 추후에 upgrade 구현 후 별도의 파일(e.g. upgrade.yaml) 정보를 기반으로 구현이 필요함.

Comment thread internal/cluster/status_report.go Resolved
Comment thread internal/cluster/status_report.go Resolved
@f1v3-dev
f1v3-dev force-pushed the refactor/cluster-status branch from 7545d22 to 88b76d8 Compare November 10, 2026 04:24
Comment thread internal/cluster/znode.go Resolved
Comment thread cmd/cluster/status.go Resolved
@claude

claude Bot commented Nov 10, 2026

Copy link
Copy Markdown

리뷰 완료 — Blocker 0건, Major 1건, Minor 1건, Question 0건

이전 리뷰에서 제기된 문서 동기화([Major], 작성자가 추후 cluster/zk status·list 작업 후 일괄 반영 예정이라 답변)와 RESPONDING 판정의 네트워크 전제([Question], 이후 커밋에서 직접 TCP 연결 대신 SSH를 통한 nc 프로브 방식으로 변경되어 해소됨)는 이번 리뷰에서 반복하지 않았습니다.

Comment thread internal/cluster/znode.go Resolved
Comment thread internal/cluster/status.go Resolved
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

APL-61

@oliviarla oliviarla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 함수/변수명이 코드 읽기에 어렵게 작용하고 있어서, 최종적으로 사용자에게 보이는 표 기준으로 용어 수정을 해야 할 것 같습니다.

Comment thread internal/cluster/status_report.go Resolved
Comment thread internal/cluster/status_report.go Resolved
Comment thread internal/cluster/status_report.go Resolved
Comment thread internal/cluster/status_report.go Resolved
Comment thread internal/cluster/status_report.go Outdated
return reasons
}

func probeErrorReason(err error) string {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extractErrorMessage 같이 error 객체에서 원하는 error message만 가져온다라는 의미를 담아야 합니다.

Comment thread internal/cluster/status_report.go Outdated
return row
}

func statusServerWarnings(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 함수명을 봐도 정확히 무엇을 수행하는지 이해하기 어렵습니다.

@f1v3-dev

Copy link
Copy Markdown
Collaborator Author

cluster status 네이밍 정리

코드 이름을 출력 용어(Nodes / ZK / Warnings)에 맞췄으며, 동작 변경은 없습니다.

파일: status_report.go → status_check.go

타입 / 필드

as-is to-be
clusterStatusReport clusterStatus
clusterStatusRow nodeStatus
Rows Nodes
Warnings ClusterWarnings
nodeWarning.Reasons nodeWarning.Messages
cacheList.Missing cacheList.Unregistered

함수

as-is to-be
evaluateClusterStatus checkCluster
buildStatusRow buildNodeStatus
statusServerWarnings nodeWarningMessages
probeErrorReason rootCause
statusCacheListWarnings 분리 (아래 참고)

statusCacheListWarnings는 반환값 두 개 중 하나가 항상 nil이어서 역할별로 나눴습니다.

  • service code 미등록 경고 → checkCluster 안으로 이동
  • 토폴로지에 없는 노드 경고 → unexpectedNodeWarnings

@f1v3-dev
f1v3-dev force-pushed the refactor/cluster-status branch from 88b76d8 to 5833d1e Compare November 24, 2026 06:58
@claude

claude Bot commented Nov 24, 2026

Copy link
Copy Markdown

지적 사항 없음

@oliviarla
oliviarla merged commit 96687fb into develop Nov 24, 2026
2 checks passed
@f1v3-dev
f1v3-dev deleted the refactor/cluster-status branch November 30, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants