Skip to content

Conversation

@oliviarla
Copy link
Collaborator

@oliviarla oliviarla commented Mar 14, 2025

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

  • ArcusClient ํด๋ž˜์Šค
    • syncCollectionPipedInsert() / syncCollectionPipedUpdate() ๋ฉ”์„œ๋“œ
      • ํ˜„์žฌ ์ˆ˜ํ–‰์ค‘์ธ op ํ•œ ๊ฐœ๊ฐ€ complete๋œ ํ›„์— ๋‹ค์Œ op๋ฅผ MemcachedNode๊ฐ€ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ๋“ฑ๋กํ•œ๋‹ค.
  • PipedCollectionFuture
    • ์ดˆ๊ธฐ์— ์ƒ์„ฑ๋œ ๋ชจ๋“  operation๋“ค์„ List ํ•„๋“œ์— ๋‹ด์•„๋‘๋„๋ก ํ•œ๋‹ค.
    • ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ cancel ์š”์ฒญ ์‹œ, ๊ธฐ์กด์— cancel ๋˜์ง€ ์•Š์€ ์ƒํƒœ๋ผ๋ฉด op๋ฅผ ์ˆœํšŒํ•˜๋ฉฐ cancel์„ ์‹œ๋„ํ•œ๋‹ค.
    • ๋‚ด๋ถ€์ ์œผ๋กœ ํ˜น์€ ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ์˜จ cancel ์š”์ฒญ์ด ์„ฑ๊ณตํ•˜์ง€ ์•Š์•˜๊ฑฐ๋‚˜, cancel ์š”์ฒญ์ด ์•„์ง ์ง„ํ–‰์ค‘์ธ ๊ฒฝ์šฐ isCancelled()๋Š” false๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • ์‚ฌ์šฉ์ž์˜ cancel ์š”์ฒญ(worker thread)๊ณผ ๋‚ด๋ถ€ ๋™์ž‘ ์ค‘ cancel ์š”์ฒญ(IO thread)์ด ๋™์‹œ์— ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.
      • BaseOperationImpl์˜ callbacked ๋ณ€์ˆ˜๋กœ ์ธํ•ด ํ•ด๋‹น ๊ฐ’์„ ๋จผ์ € ์ ์œ ํ•œ ์š”์ฒญ์ด ๋จผ์ € cancel์„ ์‹œ๋„ํ•˜๊ฒŒ ๋œ๋‹ค.
      • ์ด๋ฏธ cancel๋œ ํ›„์—๋Š” ๋‹ค๋ฅธ ์š”์ฒญ์ด cancel์„ ํ•  ์ˆ˜ ์—†๊ฒŒ ๋œ๋‹ค.
        • ์‚ฌ์šฉ์ž ์š”์ฒญ์ด ์‹คํŒจํ–ˆ๋‹ค๋ฉด Future์—์„œ ๋‹ค์Œ op์— ๋Œ€ํ•ด cancel ์š”์ฒญ์„ ๋ณด๋‚ผ ๊ฒƒ์ด๋‹ค.
        • ๋‚ด๋ถ€ ์š”์ฒญ์ด ์‹คํŒจํ–ˆ๋‹ค๋ฉด ๋ณ„๋‹ค๋ฅธ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜์ง€ ์•Š๋Š”๋‹ค.

@oliviarla oliviarla marked this pull request as ready for review March 17, 2025 05:25
@oliviarla oliviarla requested review from jhpark816 and uhm0311 March 17, 2025 05:49
Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

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

์šฐ์„  ์งˆ๋ฌธ ์œ„์ฃผ์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

1์ฐจ ๋ฆฌ๋ทฐ ์˜๊ฒฌ์ž…๋‹ˆ๋‹ค.

์ถ”๊ฐ€ ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ”๋กœ ์ง„ํ–‰ํ• ๊ฒ ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

์ถ”๊ฐ€ ๋ฆฌ๋ทฐ

Copy link
Collaborator Author

@oliviarla oliviarla left a comment

Choose a reason for hiding this comment

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

๋‹ค๋ฅธ ๋ฆฌ๋ทฐ ์‚ฌํ•ญ๋“ค์€ ๋ฐ˜์˜ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

์ผ๋ถ€ ๋ฆฌ๋ทฐ

@oliviarla oliviarla force-pushed the pipe3 branch 3 times, most recently from a7063fa to 2939657 Compare March 27, 2025 07:16
@oliviarla
Copy link
Collaborator Author

@jhpark816 ๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

@jhpark816
Copy link
Collaborator

@uhm0311 ๋ฆฌ๋ทฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

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

์งˆ๋ฌธ์ž…๋‹ˆ๋‹ค.

@oliviarla oliviarla force-pushed the pipe3 branch 2 times, most recently from ac87315 to cf6c6fa Compare April 2, 2025 09:09
@oliviarla

This comment was marked as outdated.

@oliviarla oliviarla marked this pull request as draft May 2, 2025 00:46
@oliviarla oliviarla marked this pull request as ready for review June 10, 2025 07:49
@oliviarla oliviarla force-pushed the pipe3 branch 2 times, most recently from 6c6ba28 to ab39e1e Compare July 30, 2025 12:15
@oliviarla oliviarla marked this pull request as draft July 30, 2025 12:18
@oliviarla oliviarla marked this pull request as ready for review July 30, 2025 12:40
@oliviarla oliviarla requested a review from Copilot July 30, 2025 12:42

This comment was marked as resolved.

uhm0311
uhm0311 previously approved these changes Jul 31, 2025
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

์ผ๋ถ€ ๋ฆฌ๋ทฐ

}
}
return false;
return cancelled.get();
Copy link
Collaborator

@jhpark816 jhpark816 Aug 13, 2025

Choose a reason for hiding this comment

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

future์˜ cancel(), isCancelled()๊ฐ€ ์ž์ฃผ ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์†Œ๋“œ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ,
cancelled AtomicBoolean ๊ฐ’์„ ๋”ฐ๋กœ ๋‘์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ™์€๋ฐ์š”.
๊ทธ๋ฆฌ๊ณ , ๋‹จ์ˆœ Boolean ๊ฐ’์ด์–ด๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ฒ€ํ†  ๋ฐ”๋ž๋‹ˆ๋‹ค.
๋‹ค๋ฅธ ์ชฝ์˜ bulk ์—ฐ์‚ฐ์—์„œ๋Š” ์ด๋Ÿฌํ•œ cancelled ๊ฐ’์„ ์œ ์ง€ํ•˜๋Š” ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

future์˜ cancel(), isCancelled()๊ฐ€ ์ž์ฃผ ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์†Œ๋“œ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ,
cancelled AtomicBoolean ๊ฐ’์„ ๋”ฐ๋กœ ๋‘์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ™์€๋ฐ์š”.

PipedCollectionFuture๋Š” ๋ชจ๋“  op๋ฅผ ์ทจ์†Œํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ํŠน์ • op๊ฐ€ ์ทจ์†Œ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ์ทจ์†Œ์‹œํ‚ค๊ณ  ๋ฐ”๋กœ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด ๊ณผ์ •์—์„œ cancelled ํ”Œ๋ž˜๊ทธ๋ฅผ true๋กœ ๋‘์–ด, ๋‹ค์‹œ cancel ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋˜์—ˆ์„ ๋•Œ ๋”์ด์ƒ op๋ฅผ ์ทจ์†Œํ•˜์ง€ ์•Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

๋‹จ์ˆœ Boolean ๊ฐ’์ด์–ด๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋Œ€๋ถ€๋ถ„์˜ ์ƒํ™ฉ์—์„œ cancel๊ณผ isCancelled๋ฅผ ํ•˜๋‚˜์˜ ์Šค๋ ˆ๋“œ์—์„œ๋งŒ ํ˜ธ์ถœํ•˜๊ธฐ ๋•Œ๋ฌธ์— boolean ํƒ€์ž…์„ ์‚ฌ์šฉํ•ด๋„ ๊ดœ์ฐฎ๊ธด ํ•œ๋ฐ, ์—ฌ๋Ÿฌ ์Šค๋ ˆ๋“œ์—์„œ ๋™์‹œ์— ํ˜ธ์ถœ๋˜๋Š” ์ผ€์ด์Šค๋Š” ๊ณ ๋ คํ•˜์ง€ ์•Š์•„๋„ ๋˜๋‚˜์š”?

๋‹ค๋ฅธ ์ชฝ์˜ bulk ์—ฐ์‚ฐ์—์„œ๋Š” ์ด๋Ÿฌํ•œ cancelled ๊ฐ’์„ ์œ ์ง€ํ•˜๋Š” ์ง€

๋‹ค๋ฅธ์ชฝ bulk ์—ฐ์‚ฐ์€ ๋น„๋™๊ธฐ ๋ฐฉ์‹์ด๊ธฐ ๋•Œ๋ฌธ์— ๋น„๊ตํ•˜๊ธฐ๊ฐ€ ์• ๋งคํ•ฉ๋‹ˆ๋‹ค.

public void complete() {
CollectionOperationStatus operationStatus = rv.getOperationStatus();
if (operationStatus != null && operationStatus.isSuccess()
&& !ops.get(opIdx).isCancelled()
Copy link
Collaborator

Choose a reason for hiding this comment

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

!ops.get(opIdx).isCancelled() ์กฐ๊ฑด์ด ํ•„์š”ํ•œ ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.
ํ˜„์žฌ ์—ฐ์‚ฐ์ด cancel ๋˜์—ˆ์œผ๋ฉด, operatoinStatus.isSuccess() == false ์ƒํƒœ์ด์ง€ ์•Š๋Š” ์ง€ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

์›Œ์ปค ์Šค๋ ˆ๋“œ๋กœ๋ถ€ํ„ฐ cancel์ด ํ˜ธ์ถœ๋˜์–ด CANCELED ์ƒํƒœ๋ฅผ operationStatus์— ์ €์žฅํ•˜๊ณ  complete ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๋„์ค‘์—, IO ์Šค๋ ˆ๋“œ์—์„œ ๊ฒฐ๊ณผ๋ฅผ ์ฝ์–ด๋“ค์—ฌ ์„ฑ๊ณต ์ƒํƒœ๋กœ ๋ฎ์–ด์“ธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

PipedCollectionFuture#setOperationStatus ๋ฉ”์„œ๋“œ๋ฅผ ๋ณด์‹œ๋ฉด CANCELED ์ƒํƒœ๊ฐ€ ์ €์žฅ๋˜์–ด ์žˆ๋”๋ผ๋„ ์ƒˆ๋กœ์šด ๊ฒฐ๊ณผ๋ฅผ ๋ฎ์–ด์“ฐ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

@oliviarla ๋ฆฌ๋ทฐ ์ฝ”๋ฉ˜ํŠธ ๋‹ฌ์•˜์œผ๋‹ˆ, ํ™•์ธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

Copy link
Collaborator Author

@oliviarla oliviarla left a comment

Choose a reason for hiding this comment

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

๋‚˜๋จธ์ง€ ์ฝ”๋ฉ˜ํŠธ์— ๋Œ€ํ•œ ๋ฆฌ๋ทฐ๋Š” ๋ฐ˜์˜ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

public void complete() {
CollectionOperationStatus operationStatus = rv.getOperationStatus();
if (operationStatus != null && operationStatus.isSuccess()
&& !ops.get(opIdx).isCancelled()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

์›Œ์ปค ์Šค๋ ˆ๋“œ๋กœ๋ถ€ํ„ฐ cancel์ด ํ˜ธ์ถœ๋˜์–ด CANCELED ์ƒํƒœ๋ฅผ operationStatus์— ์ €์žฅํ•˜๊ณ  complete ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๋„์ค‘์—, IO ์Šค๋ ˆ๋“œ์—์„œ ๊ฒฐ๊ณผ๋ฅผ ์ฝ์–ด๋“ค์—ฌ ์„ฑ๊ณต ์ƒํƒœ๋กœ ๋ฎ์–ด์“ธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

PipedCollectionFuture#setOperationStatus ๋ฉ”์„œ๋“œ๋ฅผ ๋ณด์‹œ๋ฉด CANCELED ์ƒํƒœ๊ฐ€ ์ €์žฅ๋˜์–ด ์žˆ๋”๋ผ๋„ ์ƒˆ๋กœ์šด ๊ฒฐ๊ณผ๋ฅผ ๋ฎ์–ด์“ฐ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

}
}
return false;
return cancelled.get();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

future์˜ cancel(), isCancelled()๊ฐ€ ์ž์ฃผ ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์†Œ๋“œ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ,
cancelled AtomicBoolean ๊ฐ’์„ ๋”ฐ๋กœ ๋‘์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ™์€๋ฐ์š”.

PipedCollectionFuture๋Š” ๋ชจ๋“  op๋ฅผ ์ทจ์†Œํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ํŠน์ • op๊ฐ€ ์ทจ์†Œ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ์ทจ์†Œ์‹œํ‚ค๊ณ  ๋ฐ”๋กœ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด ๊ณผ์ •์—์„œ cancelled ํ”Œ๋ž˜๊ทธ๋ฅผ true๋กœ ๋‘์–ด, ๋‹ค์‹œ cancel ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋˜์—ˆ์„ ๋•Œ ๋”์ด์ƒ op๋ฅผ ์ทจ์†Œํ•˜์ง€ ์•Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

๋‹จ์ˆœ Boolean ๊ฐ’์ด์–ด๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋Œ€๋ถ€๋ถ„์˜ ์ƒํ™ฉ์—์„œ cancel๊ณผ isCancelled๋ฅผ ํ•˜๋‚˜์˜ ์Šค๋ ˆ๋“œ์—์„œ๋งŒ ํ˜ธ์ถœํ•˜๊ธฐ ๋•Œ๋ฌธ์— boolean ํƒ€์ž…์„ ์‚ฌ์šฉํ•ด๋„ ๊ดœ์ฐฎ๊ธด ํ•œ๋ฐ, ์—ฌ๋Ÿฌ ์Šค๋ ˆ๋“œ์—์„œ ๋™์‹œ์— ํ˜ธ์ถœ๋˜๋Š” ์ผ€์ด์Šค๋Š” ๊ณ ๋ คํ•˜์ง€ ์•Š์•„๋„ ๋˜๋‚˜์š”?

๋‹ค๋ฅธ ์ชฝ์˜ bulk ์—ฐ์‚ฐ์—์„œ๋Š” ์ด๋Ÿฌํ•œ cancelled ๊ฐ’์„ ์œ ์ง€ํ•˜๋Š” ์ง€

๋‹ค๋ฅธ์ชฝ bulk ์—ฐ์‚ฐ์€ ๋น„๋™๊ธฐ ๋ฐฉ์‹์ด๊ธฐ ๋•Œ๋ฌธ์— ๋น„๊ตํ•˜๊ธฐ๊ฐ€ ์• ๋งคํ•ฉ๋‹ˆ๋‹ค.

@jhpark816 jhpark816 merged commit e9c7897 into naver:develop Aug 19, 2025
2 checks passed
@oliviarla oliviarla deleted the pipe3 branch August 28, 2025 08:17
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