Skip to content

Comments

FIX: Split piped operations into single-key and multi-key to resolve bug during migration#1029

Merged
jhpark816 merged 1 commit intonaver:developfrom
uhm0311:uhm0311/f/1
Dec 15, 2025
Merged

FIX: Split piped operations into single-key and multi-key to resolve bug during migration#1029
jhpark816 merged 1 commit intonaver:developfrom
uhm0311:uhm0311/f/1

Conversation

@uhm0311
Copy link
Collaborator

@uhm0311 uhm0311 commented Dec 12, 2025

🔗 Related Issue

⌨️ What I did

  • 아래와 같은 문제를 해결하기 위해, Piped operation을 Single-key piped operation과 Multi-key piped operation으로 분리합니다.
  • Single-key piped operation은 기존의 Piped operation과 동일하게 동작하며, Multi-key piped operation은 OperationCallback에 Integer index 대신 String key를 넘깁니다.
    - Original: keys = [key0, key1, key2, key3, key4]
    
    Gets migrated and split:
    - Node A: [key0, key2] →
      - calls gotStatus(0, ...) for key0 (Correct)
      - calls gotStatus(1, ...) for key2 (Error. index 1 represents key1)
    - Node B: [key1, key3, key4] → 
      - calls gotStatus(0, ...) for key1 (Error. index 0 represents key0)
      - calls gotStatus(1, ...) for key3 (Error. index 1 represents key1)
      - calls gotStatus(2, ...) for key4 (Error. index 2 represents key2)
    

구체적인 변경 사항은 다음과 같습니다.

Operation 클래스

  • PipeOperationImpl
    • Single-key인 경우와 Multi-key인 경우 모두에 사용할 수 있는 공통 로직을 갖고 있습니다.
    • 일부 로직을 추상 메소드로 변경하여 자식 클래스에서 Single-key 로직 혹은 Multi-key 로직을 수행하도록 했습니다.
  • SingleKeyPipeOperationImpl
    • PipeOperationImpl을 상속받는 새로운 추상 클래스입니다.
    • Single-key piped operation을 위한 공통 로직을 갖고 있습니다.
    • String key 필드와 SingleKeyPipedOperationCabllack cb 필드를 갖고 있습니다.
  • MultiKeyPipeOperationImpl
    • PipeOperationImpl을 상속받는 새로운 추상 클래스입니다.
    • Multi-key piped operation을 위한 공통 로직을 갖고 있습니다.
    • List<String> keys 필드와 MultiKeyPipedOperationCabllack cb 필드를 갖고 있습니다.

OperationCallback 클래스

  • PipedOperationCallback => SingleKeyPipedOperationCallback으로 변경
    • 기존의 로직(gotStatus(Integer index, OperationStatus status))을 그대로 수행하되, 이름을 SingleKeyOperationCallback으로 변경합니다.
  • MultiKeyPipedOperationCallback
    • gotStatus(String key, OperationStatus status) 로직을 수행하는 OperationCallback 인터페이스입니다.
    • Multi-key piped operation에서 어떤 Key에 대한 응답을 받았는지 구분하기 위해 새롭게 추가했습니다.

@uhm0311 uhm0311 requested a review from oliviarla December 12, 2025 06:16
@oliviarla
Copy link
Collaborator

@uhm0311
어떤 클래스가 추가되었고 각 클래스의 역할이 무엇인지, 어떤 변경이 왜 발생했는지 간단하게 첫 코멘트에 달아주시면 리뷰하기 편할 것 같습니다.

@uhm0311
Copy link
Collaborator Author

uhm0311 commented Dec 12, 2025

@oliviarla

추가했습니다.
혹시 설명이 더 필요하시다면 말씀해주세요.

@uhm0311 uhm0311 requested a review from jhpark816 December 12, 2025 09:33
@jhpark816 jhpark816 merged commit 4c1de11 into naver:develop Dec 15, 2025
2 checks 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.

3 participants