Skip to content

FIX: Manage ZooKeeper data and log directories - #51

Merged
oliviarla merged 1 commit into
developfrom
f1v3/zk
Aug 11, 2026
Merged

FIX: Manage ZooKeeper data and log directories#51
oliviarla merged 1 commit into
developfrom
f1v3/zk

Conversation

@f1v3-dev

Copy link
Copy Markdown
Collaborator

🔗 Related Issue

⌨️ What I did

  • ZooKeeper 배포 시 서버별 data_dirdata_dir_log 디렉터리를 생성하도록 수정하였습니다.
  • ZooKeeper 앙상블 삭제 시 설치 디렉터리와 data_dirdata_dir_log 디렉터리를 함께 삭제하도록 수정하였습니다.
    • 노드 디렉터리 삭제 후 비어있는 data_dir, data_log_dir 상위 디렉터리를 정리합니다.

@f1v3-dev
f1v3-dev requested review from namsic and oliviarla August 10, 2026 09:09
@f1v3-dev f1v3-dev self-assigned this Aug 10, 2026
Comment thread internal/zk/delete.go
@@ -77,11 +78,41 @@ func groupServersByHost(servers []topology.ZKServer) map[string][]topology.ZKSer
}

func removeHostFiles(host string, servers []topology.ZKServer, topoPath string) error {

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.

각각 어떤 처리를 하는건지 주석이나 별도 메서드화하는게 좋을 것 같습니다. 한번에 이해하기 어려운 상태네요ㅜ

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

불필요하게 사용자가 지정한 data_dir, data_log_dir 상위 디렉토리까지 정리하는 코드가 들어가있다보니 이해하기 어려웠던 것 같습니다.

해당 로직은 제거하고 삭제 대상을 아래와 같이 한정하고, 경로 계산 로직을 따로 분리하였습니다.

원격 호스트 삭제 대상

  • ZooKeeper 설치 경로
  • 노드별 <data_dir>/zk<myid><data_log_dir>/zk<myid> 디렉터리

@oliviarla
oliviarla merged commit 93f23fb into develop Aug 11, 2026
1 check passed
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.

2 participants