-
Notifications
You must be signed in to change notification settings - Fork 740
Add lock statistics to KQP query metrics #30268
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
base: main
Are you sure you want to change the base?
Conversation
|
🟢 |
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
⚪ Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
31243aa to
e181532
Compare
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
⚪ Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
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.
Pull request overview
This PR adds lock statistics tracking to KQP query metrics by exposing LocksBrokenAsBreaker and LocksBrokenAsVictim counters in the .sys/query_metrics_one_minute system view.
Key Changes:
- Datashard execution units now track and report the number of locks broken by a transaction (
LocksBrokenAsBreaker) - KQP executer and write actors track when transactions have their locks broken by others (
LocksBrokenAsVictim) - System view schemas updated to store and expose both lock statistics
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ydb/core/tx/datashard/execute_write_unit.cpp | Sets LocksBrokenAsBreaker stat in write operation results; includes whitespace cleanup |
| ydb/core/tx/datashard/execute_kqp_data_tx_unit.cpp | Sets LocksBrokenAsBreaker stat in KQP data transaction results with added comment |
| ydb/core/tx/datashard/execute_data_tx_unit.cpp | Sets LocksBrokenAsBreaker stat in data transaction results |
| ydb/core/tx/datashard/datashard_ut_write.cpp | Adds unit test verifying LocksBrokenAsBreaker stat for write operations |
| ydb/core/tx/datashard/datashard_ut_order.cpp | Adds unit test verifying LocksBrokenAsBreaker stat for out-of-order transactions |
| ydb/core/sys_view/ut_registry.cpp | Updates schema to include LocksBrokenAsBreaker and LocksBrokenAsVictim columns |
| ydb/core/sys_view/ut_kqp.cpp | Adds comprehensive test for both lock statistics in query metrics system view |
| ydb/core/sys_view/service/query_interval.cpp | Implements aggregation logic for lock statistics |
| ydb/core/sys_view/query_stats/query_metrics.cpp | Adds extractors for LocksBrokenAsBreaker and LocksBrokenAsVictim columns |
| ydb/core/sys_view/common/registry.h | Updates QueryMetrics schema with lock statistics columns |
| ydb/core/protos/sys_view.proto | Adds LocksBrokenAsBreaker and LocksBrokenAsVictim fields to protobuf messages |
| ydb/core/protos/query_stats.proto | Adds LocksBrokenAsBreaker field to TTxStats |
| ydb/core/protos/kqp_stats.proto | Adds TKqpLockStats message with breaker and victim counters |
| ydb/core/kqp/session_actor/kqp_session_actor.cpp | Accumulates lock statistics in query state |
| ydb/core/kqp/session_actor/kqp_query_stats.h | Adds lock statistics fields to TKqpQueryStats |
| ydb/core/kqp/session_actor/kqp_query_stats.cpp | Propagates lock statistics to query stats collection |
| ydb/core/kqp/session_actor/kqp_query_state.h | Adds lock statistics tracking to query state |
| ydb/core/kqp/runtime/kqp_write_actor.cpp | Tracks and propagates lock statistics through write actors and task stats |
| ydb/core/kqp/executer_actor/kqp_executer_stats.h | Adds lock statistics fields to TQueryExecutionStats |
| ydb/core/kqp/executer_actor/kqp_executer_stats.cpp | Aggregates lock statistics from datashard and buffer stats |
| ydb/core/kqp/executer_actor/kqp_executer.h | Adds lock statistics fields to TEvExecuterTxResponse |
| ydb/core/kqp/executer_actor/kqp_data_executer.cpp | Overrides ReplyErrorAndDie to populate lock stats; tracks LocksBrokenAsVictim |
| ydb/core/grpc_services/rpc_cluster_state.cpp | Updates schema description to include lock statistics columns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e181532 to
f9fd2f6
Compare
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
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.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
750fd25 to
06147a7
Compare
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.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
nikvas0
left a comment
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.
kqp ok
Changelog entry
Expose
LocksBrokenAsBreakerandLocksBrokenAsVictimstatistics in.sys/query_metrics_one_minutesystem view.LocksBrokenAsBreaker: Number of locks broken by this transaction.LocksBrokenAsVictim: Number of times this transaction's locks werebroken by others.
Changelog category
Description for reviewers
...