-
Notifications
You must be signed in to change notification settings - Fork 715
fix: scan_stats for each node info #8251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍(Review updated until commit 20ff213)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 20ff213
Previous suggestionsSuggestions up to commit 20ff213
|
|
Persistent review updated to latest commit 20ff213 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes an issue with scan statistics reporting in distributed search scenarios by introducing proper per-node tracking in the FlightDecoderStream implementation. The core problem was that individual nodes were not accurately tracking and reporting their own scan statistics, relying instead on shared scan_stats from QueryContext which could lead to incomplete or inaccurate per-node metrics.
The solution introduces a local scan_stats field to each FlightDecoderStream instance, initialized with default values. When processing custom messages containing scan statistics, the code now performs dual accumulation - updating both the local instance statistics and the shared context statistics. This dual approach ensures that:
- Each node maintains accurate local statistics for its own operations
- The global aggregation across all nodes continues to work correctly
- The
Dropimplementation can access precise per-node statistics for logging purposes
The changes are minimal but strategic, affecting the struct initialization, message processing logic, and the cleanup phase. This modification aligns with the distributed architecture where individual nodes need to track their own performance metrics while contributing to system-wide aggregation. The fix ensures that monitoring and observability features work correctly at both the individual node level and cluster level, which is crucial for debugging and performance analysis in distributed search operations.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it introduces local state tracking without breaking existing functionality
- Score reflects straightforward logic changes that improve statistics accuracy without modifying core search behavior
- Pay close attention to the dual accumulation pattern to ensure both local and shared statistics are properly maintained
1 file reviewed, no comments
The currently printed scan_stats are accumulated as the node returns, but the scan_stats of a node itself should be output
this change only affect log output