[MOD-13431] Add logs to index commands#8036
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8036 +/- ##
==========================================
- Coverage 83.86% 83.83% -0.04%
==========================================
Files 366 366
Lines 55186 55193 +7
Branches 14393 14393
==========================================
- Hits 46281 46269 -12
- Misses 8743 8762 +19
Partials 162 162
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/module.c
Outdated
| } | ||
|
|
||
| // Log index creation | ||
| RedisModule_Log(ctx, "notice", "Creating index"); |
There was a problem hiding this comment.
Let's remove the logs before the creations succeed
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.8
git worktree add -d .worktree/backport-8036-to-2.8 origin/2.8
cd .worktree/backport-8036-to-2.8
git switch --create backport-8036-to-2.8
git cherry-pick -x 4f0fdfae3e77d583c397cbe22785c6a43bb7639d |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-8036-to-2.10 origin/2.10
cd .worktree/backport-8036-to-2.10
git switch --create backport-8036-to-2.10
git cherry-pick -x 4f0fdfae3e77d583c397cbe22785c6a43bb7639d |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.2
git worktree add -d .worktree/backport-8036-to-8.2 origin/8.2
cd .worktree/backport-8036-to-8.2
git switch --create backport-8036-to-8.2
git cherry-pick -x 4f0fdfae3e77d583c397cbe22785c6a43bb7639d |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.4
git worktree add -d .worktree/backport-8036-to-8.4 origin/8.4
cd .worktree/backport-8036-to-8.4
git switch --create backport-8036-to-8.4
git cherry-pick -x 4f0fdfae3e77d583c397cbe22785c6a43bb7639d |
* Add logs to index commands * Avoid use after free * remove logs before command
[MOD-13431] Add logs to index commands (#8036) * Add logs to index commands * Avoid use after free * remove logs before command
[8.4] [MOD-13431] Add logs to index commands (#8049) [MOD-13431] Add logs to index commands (#8036) * Add logs to index commands * Avoid use after free * remove logs before command (cherry picked from commit 7707b97) Co-authored-by: lerman25 <[email protected]>
[MOD-13431] Add logs to index commands (#8036)
Add logging for index lifecycle operations
Added structured logging for index creation, alteration, and deletion operations to improve observability and debugging.
Changes:
FT.CREATE: Log before creation ("Creating index") and after success ("Successfully created index {name}")Note: we don't log the index name at creating since the spec is not created yet, and to log the obfuscated will introduce necessary code complexity
FT.ALTER: Log before alteration ("Altering index {name}") and after success ("Successfully altered index {name}")FT.DROPINDEX: Log after successful deletion ("Successfully dropped index {name}")Note: the index name is duplicated before deletion to avoid use-after-free, as the IndexSpec is freed during the operation.
All logs respect the hideUserDataFromLog configuration flag:
This follows the existing pattern used throughout the codebase for logging user data.
Note
Improves observability of index lifecycle events.
FT.CREATE(“Successfully created index …”),FT.ALTER(“Successfully altered index …”), andFT.DROPINDEX(“Successfully dropped index …”)IndexSpec_FormatName(...)honoringhideUserDataFromLogto obfuscate names when configuredWritten by Cursor Bugbot for commit b89ce7a. This will update automatically on new commits. Configure here.