Skip to content

[8.2] [MOD-12627] Add Debug Support for FT.PROFILE Command (#7510)#7574

Merged
meiravgri merged 2 commits into8.2from
backport-7510-to-8.2
Nov 30, 2025
Merged

[8.2] [MOD-12627] Add Debug Support for FT.PROFILE Command (#7510)#7574
meiravgri merged 2 commits into8.2from
backport-7510-to-8.2

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Nov 30, 2025

backport #7510 to 8.2


Note

Add debug support for FT.PROFILE (standalone and cluster) and refactor distributed handlers to enable debug execution, with profiling safety tweaks and tests.

  • Debug/Profiling:
    • Add debug execution path for FT.PROFILE via RSProfileCommandImp and debug wrappers (_FT.PROFILE, shard variants).
    • Introduce DEBUG_execCommandCommon to run SEARCH/AGGREGATE/PROFILE with debug params.
    • Ensure profiling skips debug-only RPs; bound-check ResultProcessor types in profile printer.
  • Distributed command refactor:
    • Split DistSearchCommand/DistAggregateCommand into *Imp(..., bool isDebug) to toggle debug handlers; update callers.
    • Route ProfileCommandHandlerImp to Dist*Imp/local based on shards and debug flag.
  • Result processor enum:
    • Reorganize with RP_MAX for non-debug and add debug-only types (RP_TIMEOUT, RP_CRASH, RP_MAX_DEBUG).
  • Aggregate exec:
    • Wire profile/debug flow (EXEC_DEBUG, handler function pointer), include module.h.
  • Debug command registry:
    • Register FT.PROFILE/_FT.PROFILE under _FT.DEBUG; add shard handlers.
  • Tests/Utils:
    • Add extensive tests for profile debug (RESP2/RESP3, SA/cluster) and helper countFlatElements.

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

* imp debug profile for SA:

introduce in mocule.h: RSProfileCommandImp
RSProfileCommand calls RSProfileCommandImp(isDebug = false) for regular execution
ProfileCommandCommand_DebugWrapper mcalls it with isDebug=true and skips _FT.DEBUG

introduce entrypoint for _FT.DEBUG FT.PROFILE in debug_commands:
ProfileCommandCommand_DebugWrapper

RSProfileCommandImp calls DEBUG_execCommandCommon is its debug

_recursiveProfilePrint skips printing debug RP

* pass is debug instead of extracting:

module.h:
replace declaration: DistAggregateCommand
DistSearchCommand
with Imp version that receives isDebug

expose ProfileCommandHandlerImp

align debug_commands

introducr _FT.DEBUG _FT.PROFILE

* add test for cluster

* return res

* augi fixes

* fix spell check

* fix for real

* fix test

* skip tests according to env

* revrt test_profile changes

* reove changes from internal_only

(cherry picked from commit 00ca3cf)
@meiravgri meiravgri requested a review from lerman25 November 30, 2025 09:28
@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.45%. Comparing base (4da0a09) to head (54d52a8).
⚠️ Report is 1 commits behind head on 8.2.

Files with missing lines Patch % Lines
src/debug_commands.c 83.33% 2 Missing ⚠️
src/profile.c 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.2    #7574      +/-   ##
==========================================
- Coverage   89.48%   89.45%   -0.03%     
==========================================
  Files         253      253              
  Lines       40990    41009      +19     
  Branches     3725     3725              
==========================================
+ Hits        36679    36684       +5     
- Misses       4262     4276      +14     
  Partials       49       49              
Flag Coverage Δ
flow 82.08% <90.90%> (-0.14%) ⬇️
unit 47.67% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@meiravgri meiravgri added this pull request to the merge queue Nov 30, 2025
Merged via the queue into 8.2 with commit 5a41e64 Nov 30, 2025
23 checks passed
@meiravgri meiravgri deleted the backport-7510-to-8.2 branch November 30, 2025 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants