Skip to content

Conversation

yumkam
Copy link
Collaborator

@yumkam yumkam commented Aug 4, 2025

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

to be rebased on top of
#21546
(changes before 6fe8fe0 should be reviewed there)

Copy link

github-actions bot commented Aug 4, 2025

2025-08-04 09:56:12 UTC Pre-commit check linux-x86_64-release-asan for 3fb1393 has started.
2025-08-04 09:56:26 UTC Artifacts will be uploaded here
2025-08-04 09:59:47 UTC ya make is running...
🔴 2025-08-04 10:16:07 UTC Build failed, see the logs. Also see fail summary

Copy link

github-actions bot commented Aug 4, 2025

2025-08-04 09:56:13 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3fb1393 has started.
2025-08-04 09:56:28 UTC Artifacts will be uploaded here
2025-08-04 09:59:52 UTC ya make is running...
🔴 2025-08-04 10:08:30 UTC Build failed, see the logs. Also see fail summary

Copy link

github-actions bot commented Aug 4, 2025

🟢 2025-08-04 10:06:53 UTC The validation of the Pull Request description is successful.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reworks watermark handling and fixes the interaction between input transforms and watermarks in the DQ (Data Query) system. The primary change is moving watermark and checkpoint handling logic from the base TDqInputImpl class to the specific TDqInputChannelImpl class to better manage barriers (watermarks/checkpoints) and their interaction with data processing.

Key changes:

  • Refactored watermark and checkpoint handling to use a barrier-based approach in input channels
  • Updated method names to distinguish between checkpoint-based and watermark-based pausing/resuming
  • Simplified the base input interface by removing pause/resume methods

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ydb/library/yql/dq/runtime/dq_input_impl.h Removes checkpoint/watermark handling from base class, simplifies Empty() logic
ydb/library/yql/dq/runtime/dq_input_channel.cpp Implements new barrier-based watermark/checkpoint handling system
ydb/library/yql/dq/runtime/dq_input_channel.h Updates interface to separate checkpoint and watermark pause/resume operations
ydb/library/yql/dq/runtime/dq_input.h Removes pause/resume methods from base interface
ydb/library/yql/dq/actors/task_runner/task_runner_actor_local.cpp Updates to use new watermark handling and track finished inputs/sources
ydb/library/yql/dq/actors/compute/dq_async_compute_actor.cpp Modifies watermark processing flow to work with new barrier system
ydb/library/yql/dq/actors/compute/dq_compute_actor_watermarks.cpp Simplifies watermark tracking by removing output channel tracking
Comments suppressed due to low confidence (1)

ydb/library/yql/dq/actors/compute/ut/dq_async_compute_actor_ut.cpp:142

  • Magic number 9999 is used without explanation. Consider using a named constant to make the error simulation condition more explicit.
    TActorId EdgeActor;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@@ -228,7 +228,7 @@ class TDqOutputChannel : public IDqOutputChannel {
}

void Push(NDqProto::TWatermark&& watermark) override {
YQL_ENSURE(!Watermark);
YQL_ENSURE(!Watermark || Watermark->GetTimestampUs() <= watermark.GetTimestampUs());
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

The watermark ordering check allows equal timestamps, but the original code only allowed pushing when no watermark existed. This change may allow duplicate watermarks with the same timestamp, which could be incorrect behavior.

Suggested change
YQL_ENSURE(!Watermark || Watermark->GetTimestampUs() <= watermark.GetTimestampUs());
YQL_ENSURE(!Watermark || Watermark->GetTimestampUs() < watermark.GetTimestampUs());

Copilot uses AI. Check for mistakes.

bool IsPaused() const override {
return BatchesBeforePause;
}
TString LogPrefix() const;
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

The LogPrefix() method is declared but not implemented in the base class. This will cause linker errors when called from derived classes that don't override it.

Suggested change
TString LogPrefix() const;
TString LogPrefix() const {
return TString("[TDqInputImpl]");
}

Copilot uses AI. Check for mistakes.

private:
void Push(TDqSerializedBatch&&) override {
Y_ABORT("Not implemented");
}

struct TBarrier {
static constexpr TInstant NoBarrier = TInstant::Zero();
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Using TInstant::Zero() as a sentinel value for 'no barrier' could be confusing since zero is a valid timestamp. Consider using TInstant::Max() or a separate boolean flag to indicate absence of a barrier.

Suggested change
static constexpr TInstant NoBarrier = TInstant::Zero();
// Use TInstant::Max() as a sentinel for both "no barrier" and "checkpoint barrier"
static constexpr TInstant NoBarrier = TInstant::Max();

Copilot uses AI. Check for mistakes.


auto sourcesMap = Sources;

Invoker->Invoke([selfId, cookie, actorSystem, replyTo, taskRunner=TaskRunner, inputMap, sourcesMap, memLimit=ev->Get()->MemLimit, settings=Settings, stageId=StageId, runtimeData=RuntimeData]() mutable {
Invoker->Invoke([selfId, cookie, actorSystem, replyTo, taskRunner=TaskRunner, inputMap=std::move(inputMap), sourcesMap=std::move(sourcesMap), memLimit=ev->Get()->MemLimit, settings=Settings, stageId=StageId, runtimeData=RuntimeData]() mutable {
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

Moving ev->Get()->InputChannels directly into inputMap and then moving inputMap again in the lambda capture creates an unnecessary move operation. Consider moving directly in the lambda capture.

Copilot uses AI. Check for mistakes.

};
std::deque<TBarrier> PendingBarriers; // barrier and counts after barrier
TBarrier BeforeBarrier; // counts before barrier
TInstant PauseBarrier; //
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

The comment for PauseBarrier is incomplete and doesn't explain what this member variable represents or how it's used.

Suggested change
TInstant PauseBarrier; //
// The barrier (watermark or checkpoint) up to which watermarks are paused or skipped.
// Used in SkipWatermarksBeforeBarrier() to determine which barriers to process or ignore.
TInstant PauseBarrier;

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 12:29:03 UTC Pre-commit check linux-x86_64-relwithdebinfo for b02460f has started.
2025-08-15 12:29:17 UTC Artifacts will be uploaded here
2025-08-15 12:32:50 UTC ya make is running...
🟡 2025-08-15 14:26:27 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39326 36549 0 4 2728 45

2025-08-15 14:29:59 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-08-15 14:47:30 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
679 (only retried tests) 645 0 0 3 31

🟢 2025-08-15 14:47:39 UTC Build successful.
🟢 2025-08-15 14:47:59 UTC ydbd size 2.3 GiB changed* by +98.9 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 76649d2 merge: b02460f diff diff %
ydbd size 2 429 927 664 Bytes 2 430 028 936 Bytes +98.9 KiB +0.004%
ydbd stripped size 508 933 192 Bytes 508 942 344 Bytes +8.9 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 12:29:39 UTC Pre-commit check linux-x86_64-release-asan for b02460f has started.
2025-08-15 12:30:07 UTC Artifacts will be uploaded here
2025-08-15 12:34:37 UTC ya make is running...
🟡 2025-08-15 14:45:36 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16726 16219 0 188 292 27

🟢 2025-08-15 14:47:12 UTC Build successful.
🟡 2025-08-15 14:47:41 UTC ydbd size 4.0 GiB changed* by +179.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 76649d2 merge: b02460f diff diff %
ydbd size 4 275 865 296 Bytes 4 276 049 448 Bytes +179.8 KiB +0.004%
ydbd stripped size 1 481 827 576 Bytes 1 481 875 544 Bytes +46.8 KiB +0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:34:31 UTC Pre-commit check linux-x86_64-relwithdebinfo for 61d33b8 has started.
2025-08-15 17:34:46 UTC Artifacts will be uploaded here
2025-08-15 17:38:20 UTC ya make is running...
2025-08-15 17:38:39 UTC Check cancelled

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:34:51 UTC Pre-commit check linux-x86_64-release-asan for 61d33b8 has started.
2025-08-15 17:35:07 UTC Artifacts will be uploaded here
2025-08-15 17:38:37 UTC Check cancelled

@yumkam yumkam force-pushed the fix-inputtransform-with-watermarks-5 branch from 1aff691 to b48c933 Compare August 15, 2025 17:38
Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:39:54 UTC Pre-commit check linux-x86_64-relwithdebinfo for 7b2e6d4 has started.
2025-08-15 17:39:58 UTC Artifacts will be uploaded here
2025-08-15 17:43:30 UTC ya make is running...
2025-08-15 17:52:55 UTC Check cancelled

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:40:38 UTC Pre-commit check linux-x86_64-release-asan for 7b2e6d4 has started.
2025-08-15 17:40:58 UTC Artifacts will be uploaded here
2025-08-15 17:44:56 UTC ya make is running...
2025-08-15 17:52:55 UTC Check cancelled

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:55:19 UTC Pre-commit check linux-x86_64-relwithdebinfo for 01a1e89 has started.
2025-08-15 17:55:35 UTC Artifacts will be uploaded here
2025-08-15 17:59:03 UTC ya make is running...
🟡 2025-08-15 19:22:57 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39326 36555 0 1 2724 46

2025-08-15 19:26:29 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-08-15 19:40:28 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
632 (only retried tests) 562 0 0 41 29

🟢 2025-08-15 19:40:38 UTC Build successful.
🟢 2025-08-15 19:40:58 UTC ydbd size 2.3 GiB changed* by +99.3 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: f71c868 merge: 01a1e89 diff diff %
ydbd size 2 429 937 104 Bytes 2 430 038 800 Bytes +99.3 KiB +0.004%
ydbd stripped size 508 933 192 Bytes 508 942 536 Bytes +9.1 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 15, 2025

2025-08-15 17:57:17 UTC Pre-commit check linux-x86_64-release-asan for 01a1e89 has started.
2025-08-15 17:57:31 UTC Artifacts will be uploaded here
2025-08-15 18:00:59 UTC ya make is running...
🟡 2025-08-15 20:03:22 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16726 16307 0 127 270 22

🟢 2025-08-15 20:04:48 UTC Build successful.
🟡 2025-08-15 20:05:17 UTC ydbd size 4.0 GiB changed* by +179.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: f71c868 merge: 01a1e89 diff diff %
ydbd size 4 275 881 888 Bytes 4 276 066 040 Bytes +179.8 KiB +0.004%
ydbd stripped size 1 481 828 600 Bytes 1 481 876 568 Bytes +46.8 KiB +0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 19, 2025

2025-08-19 14:00:14 UTC Pre-commit check linux-x86_64-release-asan for d4b436c has started.
2025-08-19 14:01:33 UTC Artifacts will be uploaded here
2025-08-19 14:05:40 UTC ya make is running...
2025-08-19 14:21:27 UTC Check cancelled

yumkam added 2 commits August 19, 2025 17:02
should be reached anyway (sending watermark via output channel will eventually result in new resume event)
Copy link

github-actions bot commented Aug 19, 2025

2025-08-19 14:26:08 UTC Pre-commit check linux-x86_64-release-asan for bcbb75a has started.
2025-08-19 14:26:26 UTC Artifacts will be uploaded here
2025-08-19 14:29:57 UTC ya make is running...
🟡 2025-08-19 16:25:36 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16787 16329 0 135 292 31

🟢 2025-08-19 16:27:07 UTC Build successful.
🟡 2025-08-19 16:27:36 UTC ydbd size 4.0 GiB changed* by +252.6 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 83e0330 merge: bcbb75a diff diff %
ydbd size 4 269 768 512 Bytes 4 270 027 176 Bytes +252.6 KiB +0.006%
ydbd stripped size 1 481 696 440 Bytes 1 481 775 736 Bytes +77.4 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 19, 2025

2025-08-19 14:46:05 UTC Pre-commit check linux-x86_64-relwithdebinfo for bcbb75a has started.
2025-08-19 14:46:20 UTC Artifacts will be uploaded here
2025-08-19 14:49:41 UTC ya make is running...
🟡 2025-08-19 16:18:38 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39393 36638 0 2 2712 41

2025-08-19 16:22:16 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-08-19 16:36:15 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
394 (only retried tests) 365 0 1 1 27

2025-08-19 16:36:26 UTC ya make is running... (failed tests rerun, try 3)
🟢 2025-08-19 16:49:22 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
240 (only retried tests) 213 0 0 1 26

🟢 2025-08-19 16:49:30 UTC Build successful.
🟡 2025-08-19 16:49:52 UTC ydbd size 2.3 GiB changed* by +151.3 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 83e0330 merge: bcbb75a diff diff %
ydbd size 2 429 060 536 Bytes 2 429 215 496 Bytes +151.3 KiB +0.006%
ydbd stripped size 509 211 624 Bytes 509 235 624 Bytes +23.4 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link
Collaborator

@Hor911 Hor911 left a comment

Choose a reason for hiding this comment

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

PR does not match RFC https://nda.ya.ru/t/I8zckxs17HpogX

Hor911
Hor911 previously approved these changes Aug 21, 2025
Copy link

github-actions bot commented Aug 26, 2025

2025-08-26 09:16:53 UTC Pre-commit check linux-x86_64-relwithdebinfo for 4a9e4aa has started.
2025-08-26 09:17:08 UTC Artifacts will be uploaded here
2025-08-26 09:20:30 UTC ya make is running...
🟡 2025-08-26 10:50:18 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39547 36796 0 2 2715 34

2025-08-26 10:53:38 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-08-26 11:15:46 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
480 (only retried tests) 431 0 1 25 23

2025-08-26 11:15:56 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-08-26 11:37:25 UTC Some tests failed, follow the links below.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
236 (only retried tests) 210 0 2 0 24

🟢 2025-08-26 11:37:33 UTC Build successful.
🟡 2025-08-26 11:37:57 UTC ydbd size 2.3 GiB changed* by +106.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: ff32d34 merge: 4a9e4aa diff diff %
ydbd size 2 432 925 696 Bytes 2 433 035 048 Bytes +106.8 KiB +0.004%
ydbd stripped size 509 684 008 Bytes 509 712 040 Bytes +27.4 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Aug 26, 2025

2025-08-26 09:17:25 UTC Pre-commit check linux-x86_64-release-asan for 4a9e4aa has started.
2025-08-26 09:17:40 UTC Artifacts will be uploaded here
2025-08-26 09:21:02 UTC ya make is running...
🟡 2025-08-26 11:36:47 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16913 16470 0 145 271 27

🟢 2025-08-26 11:38:13 UTC Build successful.
🟡 2025-08-26 11:38:47 UTC ydbd size 4.0 GiB changed* by +185.0 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: ff32d34 merge: 4a9e4aa diff diff %
ydbd size 4 275 543 040 Bytes 4 275 732 440 Bytes +185.0 KiB +0.004%
ydbd stripped size 1 482 893 272 Bytes 1 482 968 472 Bytes +73.4 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants