Skip to content

[MOD-12899] add asm warning in Profile#7913

Merged
JoanFM merged 42 commits intomasterfrom
joan-isprofile-warning
Jan 8, 2026
Merged

[MOD-12899] add asm warning in Profile#7913
JoanFM merged 42 commits intomasterfrom
joan-isprofile-warning

Conversation

@JoanFM
Copy link
Collaborator

@JoanFM JoanFM commented Dec 29, 2025

Describe the changes in the pull request

Handle the warning from ASM in profile


Note

Highlights ASM-related inaccuracy to users and tooling during Atomic Slot Migration.

  • Add PROFILE_WARNING_TYPE_ASM_INACCURATE_RESULTS to profile.h; include it in Profile_Print warnings and bitset checks
  • In aggregate_exec.c, when QEXEC_S_ASM_TRIMMING_DELAY_TIMEOUT is set, update global stats, add PROFILE_WARNING_TYPE_ASM_INACCURATE_RESULTS, and reply QUERY_ASM_INACCURATE_RESULTS across RESP2, RESP3, and empty-results paths (including cursor flows and _replyWarnings)
  • Extend tests in tests/pytests/test_asm.py to verify FT.CURSOR PROFILE returns the ASM warning during migration (both single-threaded and BG variants)

Written by Cursor Bugbot for commit 9c702cf. This will update automatically on new commits. Configure here.

@JoanFM JoanFM self-assigned this Dec 29, 2025
Copy link
Collaborator

@meiravgri meiravgri left a comment

Choose a reason for hiding this comment

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

few small comments

src/profile.c Outdated
}
} else {
printProfileType("TEXT");
} else if (root && root->current) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change related to this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have another PR open for a crash found with this change, u can review that one separately

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@meiravgri
Copy link
Collaborator

Please add a short description and a MOD reference

@JoanFM JoanFM changed the title add asm warning in Profile [MOD-12899] add asm warning in Profile Jan 6, 2026
@JoanFM JoanFM requested a review from meiravgri January 6, 2026 12:39
ProfileWarnings_Add(&req->profileCtx.warnings, PROFILE_WARNING_TYPE_BG_SCAN_OOM);
}
if (req->stateflags & QEXEC_S_ASM_TRIMMING_DELAY_TIMEOUT) {
QueryWarningsGlobalStats_UpdateWarning(QUERY_WARNING_CODE_ASM_INACCURATE_RESULTS, 1, !IsInternal(req));
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do we know we didn't already log this event to the metric counter in sendChunk?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not quite get it, this is a different code path. Same as other warnings? These are totally different return paths so why would they be called them together? If the concern is about coord/shard separation, there is the bool coord to differentiate the level.

Copy link
Collaborator

Choose a reason for hiding this comment

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

not completely different paths - this function is also called from _FT.CURSOR PFOILE , which might be triggered after the previous cursor read already passed sendChunck path.
Unlike query oom which is triggered first thing first, and the code goes directly here.

Also for sendChunk itself, if we have multiple cursor reads, is it correct to log the same event to the metric counter each time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to me it is ok to log for every ft cursor read one warning event yes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok if it makes sense...

@JoanFM JoanFM requested a review from meiravgri January 8, 2026 14:58
@JoanFM JoanFM enabled auto-merge January 8, 2026 15:41
@JoanFM JoanFM added this pull request to the merge queue Jan 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2026
@JoanFM JoanFM added this pull request to the merge queue Jan 8, 2026
Merged via the queue into master with commit b010ea6 Jan 8, 2026
32 checks passed
@JoanFM JoanFM deleted the joan-isprofile-warning branch January 8, 2026 20:16
github-merge-queue bot pushed a commit that referenced this pull request Jan 20, 2026
…because of ASM and add asm warnings in profile (#7869)(#7899)(#7913) (#8087)

* manual backport of ASM warnings

* remove some warning

* test: change timeout test to not collide with RLTest timeout

* asm warnings profile

* add new case

* test: add condition for source shard to pass migration

* add back time sleep to test
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