Skip to content

Conversation

@oliviarla
Copy link
Collaborator

@oliviarla oliviarla commented Dec 23, 2025

πŸ”— Related Issue

  • Pipeline APIλ₯Ό μΆ”κ°€ν•©λ‹ˆλ‹€.
  • μ‚¬μš© 방법
    • Pipeline 객체λ₯Ό μƒμ„±ν•˜μ—¬ ν•˜λ‚˜μ˜ νŒŒμ΄ν”„λΌμΈμœΌλ‘œ 포함할 λͺ…령듀을 μ‘°ν•©ν•œλ‹€.
    • νŒŒμ΄ν”„λΌμΈμ— 포함할 수 μžˆλŠ” λͺ…령듀을 μ œν•œν•  수 μžˆλ‹€. (λͺ…λ Ήμ–΄μ˜ μ’…λ₯˜, 개수)
    • λͺ…λ Ήμ–΄μ˜ κ°œμˆ˜λŠ” μ΅œλŒ€ 500개둜 μ œν•œν•œλ‹€. 이λ₯Ό 톡해 ν•œ λ…Έλ“œμ—λŠ” μ΅œλŒ€ ν•˜λ‚˜μ˜ νŒŒμ΄ν”„λΌμΈμ΄ 보내진닀.
    public class Pipeline<V> {
    
        // λ‹€μ–‘ν•œ λͺ…령을 포함할 수 μžˆλŠ” PipelineOperationImpl νƒ€μž…μ„ value에 μ €μž₯ν•œλ‹€.
        private Map<MemcachedNode, Operation> ops;
        
        public Pipeline() {
          // ...
        }
        
        public Pipeline<V> lopInsert(String key, int index, V value) {
          // ...
          return this;
        }
        
        public Pipeline<V> mopInsert(String key, String mkey, V value) {
          // ...
          return this;
        }
        
        // ...
        
    }
    • λͺ…λ Ήμ˜ μ‘°ν•© μˆœμ„œλŒ€λ‘œ νŒŒμ΄ν”„λΌμΈμ΄ λ§Œλ“€μ–΄μ§€μ§€λ§Œ, μ„œλ²„μ—μ„œ 처리 도쀑 λ‹€λ₯Έ 연산이 끼어듀 수 μžˆλ‹€.
    • μ„œλ‘œ λ‹€λ₯Έ μ—¬λŸ¬ ν‚€λ₯Ό νŒŒμ΄ν”„λΌμΈμ— ν¬ν•¨ν•˜λŠ” 경우, 각 λ…Έλ“œ λ³„λ‘œ νŒŒμ΄ν”„λΌμΈμ΄ μƒμ„±λ˜μ–΄ λ…Έλ“œμ— μ „λ‹¬λœλ‹€.
    • Pipeline 객체λ₯Ό execute λ©”μ„œλ“œμ— λ„˜κ²¨μ•Ό νŒŒμ΄ν”„λΌμΈμ΄ μˆ˜ν–‰λ˜λ©°, List<Object> 에 각 λͺ…령에 λŒ€ν•œ 응닡이 λ‹΄κΈ΄λ‹€.
    ArcusFuture<List<Object>> execute(Pipeline<T> pipeline)

⌨️ What I did

  • μ˜ˆμ™Έ 처리
    • λͺ¨λ“  응닡이 올 λ•Œ κΉŒμ§€ κΈ°λ‹€λ¦° ν›„ μ—¬λŸ¬ μš”μ²­μ—μ„œ λ°œμƒν•œ μ‹€νŒ¨/μ—λŸ¬λ“€μ„ ν•˜λ‚˜μ˜ CompositeException νƒ€μž…μœΌλ‘œ λͺ¨μ•„ λ˜μ§„λ‹€.
  • switchover 처리
    • responseIndexλ₯Ό μ‚¬μš©ν•˜μ—¬ 아직 응닡이 μ˜€μ§€ μ•Šμ€ operationλ“€λ§Œ μƒˆλ‘œμš΄ master λ…Έλ“œμ—μ„œ initializeν•  λ•Œ ν¬ν•¨λ˜λ„λ‘ ν•œλ‹€.
  • migration 처리
    • gotStatus λ©”μ„œλ“œμ˜ 인자둜 Operation을 λ°›μ•„, μ—¬λŸ¬ Operation으둜 λΆ„λ¦¬λ˜λ”λΌλ„ 원본 μ½œλ°±μ—μ„œ 원본 index에 값을 μΆ”κ°€ν•  수 μžˆλ„λ‘ ν•œλ‹€.

@oliviarla oliviarla force-pushed the pipenewapi branch 2 times, most recently from 7a9e90a to 0d98bc8 Compare January 22, 2026 06:42
@oliviarla oliviarla requested a review from uhm0311 January 22, 2026 06:42
* NOTHING_TO_UPDATE, NOT_SUPPORTED
* or unknown statement
*/
atomicReference.get().set(index, status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

List<Object>둜 λ°˜ν™˜ν•˜λŠ” 것보닀 PipelineResult 클래슀λ₯Ό λ§Œλ“€μ–΄μ„œ List<Boolean> ν•„λ“œμ™€ Exception ν•„λ“œλ₯Ό λ„£μ–΄μ„œ λ°˜ν™˜ν•˜λŠ” 것이 λ‚«μ§€ μ•Šλ‚˜μš”?
κ²°κ³Όλ₯Ό λ°›μ•„μ„œ μ‚¬μš©ν•˜λŠ” μͺ½μ—μ„œ 맀번 νƒ€μž… μ²΄ν¬ν•˜κ³  νƒ€μž… λ³€ν™˜μ„ ν•˜λŠ” 것보닀 λ‚˜μ„ 것 κ°™μŠ΅λ‹ˆλ‹€.

Copy link
Collaborator Author

@oliviarla oliviarla Jan 27, 2026

Choose a reason for hiding this comment

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

λ°˜ν™˜ νƒ€μž…μ— λŒ€ν•΄ λ…Όμ˜ν•΄λ³΄λŠ” 게 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.
μ œμ‹œν•΄μ£Όμ‹  κ²ƒμ²˜λŸΌ 별도 클래슀λ₯Ό λ§Œλ“€κΈ°λ³΄λ‹€λŠ” Map<Integer, CollectionOperationStatus>νƒ€μž…μ„ λ°˜ν™˜ν•΄μ„œ μ‹€νŒ¨ μ‹œ causeλ§Œμ„ μ €μž₯ν•˜λŠ”κ±΄ μ–΄λ–€κ°€μš”? λͺ¨λ‘ μ„±κ³΅ν•œ 경우 Map은 emptyκ°€ λ©λ‹ˆλ‹€.

Copy link
Collaborator

Choose a reason for hiding this comment

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

λ‹€λ₯Έ APIμ—μ„œλŠ” CollectionOperationStatusκ°€ μ•„λ‹Œ Exception을 λ°˜ν™˜ν•˜λŠ” κ²ƒμœΌλ‘œ λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
μ—¬κΈ°μ„œλ„ Map<Integer, Exception> νƒ€μž…μœΌλ‘œ λ°˜ν™˜ν•˜λŠ” 것은 μ–΄λ–€κ°€μš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pipeλŠ” multi key 연산이 될 μˆ˜λ„ 있으며 이둜 인해 μ›μžμ„±, μˆœμ„œλ₯Ό 보μž₯ν•  수 μ—†μŠ΅λ‹ˆλ‹€.
예λ₯Ό λ“€μ–΄ 500개의 λͺ…령을 νŒŒμ΄ν”„λ‘œ λ¬Άμ–΄ execute λ©”μ„œλ“œλ‘œ μ‹€ν–‰μ‹œν‚€κ³ μž ν•˜κ³ , 5개의 λ…Έλ“œμ—μ„œ 각각 100κ°œμ”© λͺ…령을 μ²˜λ¦¬ν•˜λ˜ 도쀑, νŠΉμ • ν•œ λ…Έλ“œμ—μ„œ 50번째 λͺ…령에 μ—λŸ¬κ°€ λ°œμƒν•΄ 이후 λͺ…령을 μ‹€ν–‰ν•˜μ§€ μ•Šμ•˜μ„ λ•Œ 이λ₯Ό μ–΄λ–»κ²Œ ν‘œν˜„ν•  μ§€ κ²°μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

μ˜€ν”„λΌμΈμœΌλ‘œ λ…Όμ˜ν–ˆμ„ λ•Œ λ‹€μŒκ³Ό 같은 클래슀λ₯Ό λ°˜ν™˜ν•˜λŠ” 것을 μ œμ•ˆν–ˆλŠ”λ°, μ—¬κΈ°μ„œ μ‹€ν–‰λ˜μ§€ μ•Šμ€ λͺ…λ Ή μΈλ±μŠ€μ—λŠ” NOT_EXECUTED OperationStatusλ₯Ό μ €μž₯ν•΄λ‘λŠ”κ²Œ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

public class PipelineResult {
    private final Map<Integer, OperationStatus> statusFailures;
    private final Map<Integer, Throwable> exceptions;
}

@uhm0311 λ‹€λ₯Έ μ œμ•ˆμ΄ μžˆλ‹€λ©΄ μ½”λ©˜νŠΈ λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

μ½”λ“œ μˆ˜μ •μ€ @jhpark816 λ‹˜κΉŒμ§€ ν™•μΈν•œ ν›„ μ§„ν–‰ν•˜κ² μŠ΅λ‹ˆλ‹€.

Copy link
Collaborator

@jhpark816 jhpark816 Feb 1, 2026

Choose a reason for hiding this comment

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

@oliviarla @uhm0311
List<Object> 응닡과 PipelineResult 응닡 ν˜•μ‹μ—μ„œ μ•„λž˜ 였λ₯˜ μ‹œμ— μ–΄λ–»κ²Œ ν‘œν˜„ν•˜κ²Œ λ˜λ‚˜μš”?

  • ERROR|CLIENT_ERROR|SERVER_ERROR
  • PIPE_ERROR
  • opertion timeout
  • cancel (by worker thread or io thread)

Copy link
Collaborator Author

@oliviarla oliviarla Feb 2, 2026

Choose a reason for hiding this comment

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

  • operation timeout의 경우 complete 둜직과 λ¬΄κ΄€ν•˜λ―€λ‘œ 이 λ…Όμ˜μ™€ 연관이 μ—†μŠ΅λ‹ˆλ‹€.
  • cancel의 경우 항상 complete exceptionally되기 λ•Œλ¬Έμ— μ˜ˆμ™Έλž‘ λ™μΌμ‹œν•©λ‹ˆλ‹€.

List<Object>

  • νŠΉμ • λ…Έλ“œμ— 보낸 μ‘λ‹΅μ—μ„œ μ—λŸ¬κ°€ λ°œμƒν•˜μ§€ μ•Šμ•˜λ‹€λ©΄, 응닡 κ²°κ³Ό(true/false/OperationStatus)κ°€ List에 μ €μž₯λ©λ‹ˆλ‹€.
  • νŠΉμ • λ…Έλ“œμ— 보낸 μ‘λ‹΅μ—μ„œ μ—λŸ¬κ°€ λ°œμƒν•œ 경우(cancel 포함), ν•΄λ‹Ή λ…Έλ“œλ‘œ λ³΄λƒˆλ˜ λͺ¨λ“  μš”μ²­μ— λŒ€ν•΄ null이 List에 μ €μž₯λ©λ‹ˆλ‹€. 각 λ…Έλ“œλ‘œ μš”μ²­μ„ λ³΄λ‚΄λŠ” λ©”μ„œλ“œμ—μ„œ ArcusFutureImplλ₯Ό λ°˜ν™˜ν•˜κΈ° λ•Œλ¬Έμ—, exceptionally complete된 경우 κ²°κ³Ό 값을 확인할 수 μ—†κΈ° λ•Œλ¬Έμ΄μ—ˆμŠ΅λ‹ˆλ‹€.

PipelineResult

  • νŠΉμ • λ…Έλ“œμ— 보낸 μ‘λ‹΅μ—μ„œ μ—λŸ¬κ°€ λ°œμƒν•˜μ§€ μ•Šμ•˜λ‹€λ©΄, μ‹€νŒ¨ 응닡 κ²°κ³Ό(OperationStatus)κ°€ status Map에 μ €μž₯λ©λ‹ˆλ‹€.
  • νŠΉμ • λ…Έλ“œμ— 보낸 μ‘λ‹΅μ—μ„œ μ—λŸ¬κ°€ λ°œμƒν•œ 경우(cancel 포함), μ—λŸ¬ 내뢀에 λ‹΄μ•„λ‘” <μ‹€νŒ¨ 응닡 결과와 μ—λŸ¬κ°€ λ°œμƒν•œ μœ„μΉ˜>λ₯Ό ν† λŒ€λ‘œ μ‹€νŒ¨ 응닡 결과와 NOT_EXECUTED μƒνƒœλ₯Ό status Map에 μ €μž₯ν•˜κ³ , μ—λŸ¬ μžμ²΄λ„ throwable Map에 μ €μž₯ν•©λ‹ˆλ‹€.

Copy link
Collaborator

@jhpark816 jhpark816 Feb 2, 2026

Choose a reason for hiding this comment

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

응닡 κ²°κ³Όλ₯Ό true, falseκ°€ μ•„λ‹Œ λͺ¨λ‘ OperationStatus둜 λ¦¬ν„΄ν•˜λŠ” 것은 μ–΄λ–€μ§€?
λ”°λΌμ„œ, List<OperationStatus> λ¦¬ν„΄ν•˜λŠ” 것은 μ–΄λ–€κ°€μš”?
였λ₯˜λ‘œ μˆ˜ν–‰λ˜μ§€ μ•Šμ•˜κ±°λ‚˜ μˆ˜ν–‰ κ²°κ³Όλ₯Ό μ•Œ 수 μ—†μœΌλ©΄, null μ €μž₯ν•˜κ³ μš”.

});
}

private Map<MemcachedNode, Map.Entry<List<KeyedOperation>, List<Integer>>> getOpsAndIndexesByNode(
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 λ©”μ†Œλ“œμ™€ getFutureToOriginIndexes()μ—μ„œ μ‚¬μš©ν•˜λŠ” μžλ£Œκ΅¬μ‘°λ“€μ΄ λ³΅μž‘ν•œ 것 κ°™μŠ΅λ‹ˆλ‹€.
각 Entry의 Key와 Valueλ₯Ό μž„μ‹œ λ³€μˆ˜μ— λ‹΄μ•„μ„œ μ‚¬μš©ν•˜κ³ , μ–΄λ–€ 역할을 ν•˜λŠ” λ³€μˆ˜μΈμ§€ μ•Œμ•„λ³Ό 수 있으면 μ’‹κ² μŠ΅λ‹ˆλ‹€.

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