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์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

});
}

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