KVStore: fix tiflash_raft_throughput_bytes warp problem (#10700)#10705
KVStore: fix tiflash_raft_throughput_bytes warp problem (#10700)#10705ti-chi-bot wants to merge 2 commits intopingcap:release-8.5from
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@JaySon-Huang This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
📝 WalkthroughWalkthroughIntroduces an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@dbms/src/Storages/KVStore/MultiRaft/RaftCommands.cpp`:
- Around line 351-380: Remove the unresolved merge conflict markers (<<<<<<<,
=======, >>>>>>>) and keep the intended new logic block that defines
deleting_lock_keys, computes lock_count from cmds.cmd_cf, reserves
deleting_lock_keys, and defines update_write_size (handling positive and
negative payloads with the INT64_MIN-safe decrement); ensure the final code
contains only the new logic (no conflict markers) and apply the same cleanup for
the other conflicted region that mirrors this change (the block around the
update_write_size/deleting_lock_keys logic).
🧹 Nitpick comments (1)
dbms/src/Storages/KVStore/MultiRaft/RaftCommands.cpp (1)
360-379: Rename new variables to camelCase per C++ guidelines.
The newly introduced identifiers use snake_case (deleting_lock_keys,lock_count,update_write_size) but this codebase guideline requires camelCase.As per coding guidelines, method and variable names in C++ must use camelCase.♻️ Suggested rename
- std::vector<TiKVKey> deleting_lock_keys; - const size_t lock_count + std::vector<TiKVKey> deletingLockKeys; + const size_t lockCount = std::count_if(cmds.cmd_cf, cmds.cmd_cf + cmds.len, [](auto cf) { return cf == ColumnFamilyType::Lock; }); - deleting_lock_keys.reserve(lock_count); - auto update_write_size = [&write_size](Int64 payload) { + deletingLockKeys.reserve(lockCount); + auto updateWriteSize = [&write_size](Int64 payload) { if (payload > 0) { write_size += static_cast<size_t>(payload); } else if (payload < 0) { // A lock being rewritten could lead to a negative payload. // Try to turn the negative payload into a positive decrement on `write_size`. const auto dec = static_cast<size_t>(-(payload + 1)) + 1; // avoid INT64_MIN overflow if (write_size >= dec) write_size -= dec; else write_size = 0; } }; @@ - update_write_size(payload); + updateWriteSize(payload);Also applies to: 418-418
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
[LGTM Timeline notifier]Timeline:
|
This is an automated cherry-pick of #10700
What problem does this PR solve?
Issue Number: close #10701
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Summary by CodeRabbit