Skip to content

*: Update rustc to update time crate#19367

Merged
ti-chi-bot[bot] merged 33 commits intotikv:masterfrom
v01dstar:fix-RUSTSEC-2026-0009
Feb 15, 2026
Merged

*: Update rustc to update time crate#19367
ti-chi-bot[bot] merged 33 commits intotikv:masterfrom
v01dstar:fix-RUSTSEC-2026-0009

Conversation

@v01dstar
Copy link
Copy Markdown
Member

@v01dstar v01dstar commented Feb 11, 2026

What is changed and how it works?

Issue Number: Close #19355

What's Changed:

Update time crate to fix RUSTSEC-2026-0009.

Updating time crate requires:

  1. Update rustc nightly version
    1.1. Requires removing let-chains usage unless edition is set to 2024, feature(let_chains) does not work
    1.2. It is more "readable" removing all let_chains rather than bump Rust edition to 2024, I recommend we upgrade Rust edition to 2024 separately, and upgrade each module individually. created Update Rust edition to 2024 #19368 for tracking
  2. Update raft-engine serde version, see the comment here Clippy failed due to RUSTSEC-2026-0009 #19355 (comment)
    2.1 The raft-engine PR is Update serde, so TiKV can update time crate raft-engine#390

Can we separate this into multiple smaller PRs:

Yes and No. TiKV CI is failing, any PR requires fixing RUSTSEC, fixing RUSTSEC requires update nightly version, and here we are again...

Files need attentions:

components/compact-log-backup/src/execute/mod.rs
components/raftstore/src/coprocessor/config.rs
components/raftstore/src/store/fsm/peer.rs
components/raftstore/src/store/worker/split_check.rs
components/tidb_query_datatype/src/codec/mysql/time/mod.rs
components/tidb_query_expr/src/impl_time.rs
src/config/mod.rs
src/storage/txn/actions/prewrite.rs

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

None

Summary by CodeRabbit

  • Refactor

    • Simplified conditional and branching logic across the codebase for clearer, more maintainable control flow.
  • Chores

    • Removed reliance on an unstable Rust feature to improve compatibility with stable toolchains.
    • Updated the Rust toolchain to a newer nightly release.

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Copilot AI review requested due to automatic review settings February 11, 2026 22:44
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/needs-triage-completed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 11, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR removes the nightly let_chains feature from multiple crates, refactors chained let-style conditionals into explicit nested checks across many modules, and updates the rust-toolchain to nightly-2026-01-30. Most edits are control-flow reshaping and assertion-style changes; behavior and public APIs are preserved.

Changes

Cohort / File(s) Summary
Feature Gate Removals
cmd/tikv-ctl/src/main.rs, components/encryption/src/lib.rs, components/engine_rocks/src/lib.rs, components/engine_traits/src/lib.rs, components/hybrid_engine/src/lib.rs, components/in_memory_engine/src/lib.rs, components/pd_client/src/lib.rs, components/raftstore-v2/src/lib.rs, components/raftstore/src/lib.rs, components/resolved_ts/src/lib.rs, components/resource_control/src/lib.rs, components/server/src/lib.rs, components/test_raftstore-v2/src/lib.rs, components/test_raftstore/src/lib.rs, components/tikv_util/src/lib.rs, src/lib.rs
Removed crate-level #![feature(let_chains)] attributes. No behavioral or public API changes.
Toolchain Update
rust-toolchain.toml
Updated Rust toolchain channel from nightly-2025-02-28 to nightly-2026-01-30.
Clippy / Config File
clippy.toml
Two keys were added then removed in the patch; final file content is unchanged (no net config change).
Conditional Refactoring — Broad (many files)
components/engine_rocks/src/..., components/in_memory_engine/src/..., components/raftstore-v2/src/..., components/raftstore/src/..., components/resource_control/src/resource_limiter.rs, components/tikv_util/src/worker/pool.rs, src/config/mod.rs, src/coprocessor/endpoint.rs, src/server/..., src/server/tablet_snap.rs, src/storage/..., src/server/engine_factory.rs, src/server/lock_manager/waiter_manager.rs
Converted chained if let / pattern + guard expressions into explicit nested if/if let blocks across many modules. Preserved semantics; changes are structural for readability/compatibility.
Conditional Refactoring — Complex logic paths
components/encryption/src/manager/mod.rs, components/raftstore-v2/src/operation/command/admin/compact_log.rs, components/raftstore-v2/src/operation/command/admin/merge/{commit,prepare,rollback}.rs, components/raftstore-v2/src/operation/ready/{mod.rs,snapshot.rs,apply_trace.rs}, components/raftstore-v2/src/operation/command/mod.rs, components/raftstore-v2/src/operation/command/write/ingest.rs, components/raftstore-v2/src/operation/unsafe_recovery/..., components/raftstore/src/store/fsm/peer.rs, src/server/tablet_snap.rs, src/config/mod.rs
Reorganized multi-condition guards, tightened rotation/rollback windows, reordered state-update sequences, and made early-return and validation paths explicit. Behavior preserved but sequencing and gating were restructured in stateful flows.
Assertion Style Updates
components/raftstore-v2/src/operation/ready/snapshot.rs, components/raftstore/src/store/simple_write.rs, src/storage/mod.rs
Replaced assert_matches! / debug macro uses with assert!(matches!(...)) or debug_assert!(matches!(...)). No runtime behavioral changes except assertion mechanism.
Iterator / Pointer Access Micro-refactor
components/crossbeam-skiplist/src/base.rs
Adjusted pointer/tower access expression from direct indexing to (&(*self.node).tower)[0]. Semantics unchanged.
Loop / Stream Handling Change
components/tikv_util/src/worker/pool.rs
Rewrote interval loop to match on interval.next() with explicit break on exhaustion instead of a compound loop condition. Preserved behavior for routine wakeups and task execution.
Various small behavioural-preserving refactors
cmd/tikv-ctl/src/executor.rs, components/engine_rocks/src/misc.rs, components/engine_rocks/src/raft_engine.rs, components/engine_rocks/src/rocks_metrics.rs, components/engine_rocks/src/util.rs, components/engine_test/src/lib.rs, components/in_memory_engine/src/region_manager.rs, components/raftstore-v2/src/... (multiple), components/raftstore/src/... (multiple), components/resolved_ts/src/lib.rs, components/resource_control/src/lib.rs, components/test_raftstore/src/..., src/server/debug.rs, src/server/debug2.rs, src/server/raftkv*/raft_extension.rs
Minor restructures: split combined conditions, changed assertion macros, moved small blocks inward, and adjusted error/log gating. No changes to public APIs or functional behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related issues

  • #19355: Clippy failed due to RUSTSEC-2026-0009 — Removing let_chains and updating toolchain addresses the security/clippy failure reported.
  • Update Rust edition to 2024 #19368 — Migration from nightly let_chains — This PR’s bulk refactors match the objective of eliminating let_chains usage and converting chained patterns.

Poem

🐰
I nibbled chains of nightly code,
Rewrote the hops in tidy rows,
Nested ifs now line the road,
A toolchain fresh — how the garden grows!

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.74% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description covers the main objective of updating the time crate and removing let-chains usage, but lacks completeness in test coverage and release note justification. Specify which test category applies (at least one of Unit/Integration/Manual test must be checked), provide clear justification for the 'No code' selection if no tests are included, and document the rationale for the release note status.
Title check ❓ Inconclusive The title '*: Update rustc to update time crate' is overly vague and does not accurately convey the main objective. The PR primarily addresses RUSTSEC-2026-0009 by updating the time crate and removing let-chains usages, but the title incorrectly suggests updating rustc is the primary goal. Clarify the title to better reflect the main change, such as ': Remove let-chains and update time crate for RUSTSEC-2026-0009' or ': Update time crate and remove let-chains to resolve security advisory'.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses all objectives from issue #19355: eliminating Clippy failures from RUSTSEC-2026-0009 by updating the time crate, removing let-chains usage, and updating dependent crates like raft-engine.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to the linked issue objectives: removing let-chains feature gates, refactoring let-chain patterns to nested conditionals, updating rust-toolchain.toml, and addressing related crate dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates TiKV’s Rust dependency set to address RUSTSEC-2026-0009 by upgrading the time crate and its transitive dependencies, which also necessitates bumping the pinned nightly toolchain and refactoring code away from the let_chains feature.

Changes:

  • Bump Rust nightly toolchain and update time (and related deps) in Cargo.lock.
  • Remove #![feature(let_chains)] across crates and refactor if let ... && ... usages into nested conditionals.
  • Add a workspace [patch] override for raft-engine to a fork/branch to pick up a serde-related update.

Reviewed changes

Copilot reviewed 79 out of 80 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/storage/txn/flow_controller/singleton_flow_controller.rs Refactor let_chains usage to nested if.
src/storage/txn/actions/prewrite.rs Refactor let_chains usage to nested if.
src/storage/mod.rs Replace assert_matches! usage with assert!(matches!(...)) and drop import.
src/server/tablet_snap.rs Refactor let_chains usage to nested if.
src/server/service/kv.rs Refactor let_chains usage to nested if.
src/server/raftkv2/raft_extension.rs Refactor let_chains in feed (introduces behavior change).
src/server/raftkv/raft_extension.rs Refactor let_chains in feed (introduces behavior change).
src/server/lock_manager/waiter_manager.rs Refactor let_chains usage to nested if.
src/server/engine_factory.rs Refactor let_chains usage to nested if.
src/server/debug2.rs Refactor let_chains usage to nested if.
src/server/debug.rs Refactor let_chains usage to nested if.
src/lib.rs Remove #![feature(let_chains)].
src/coprocessor/endpoint.rs Refactor let_chains usage to nested if.
src/config/mod.rs Refactor let_chains usage to nested if / if-nesting.
rust-toolchain.toml Bump pinned nightly toolchain date.
components/tikv_util/src/worker/pool.rs Refactor while ... && let ... into loop+match.
components/tikv_util/src/lib.rs Remove #![feature(let_chains)].
components/test_raftstore/src/lib.rs Remove #![feature(let_chains)].
components/test_raftstore/src/cluster.rs Refactor let_chains usage to nested if.
components/test_raftstore-v2/src/lib.rs Remove #![feature(let_chains)].
components/server/src/signal_handler.rs Refactor let_chains usage to nested if.
components/server/src/lib.rs Remove #![feature(let_chains)].
components/resource_control/src/resource_limiter.rs Refactor let_chains usage to nested if.
components/resource_control/src/lib.rs Remove #![feature(let_chains)].
components/resolved_ts/src/lib.rs Remove #![feature(let_chains)].
components/raftstore/src/store/worker/split_controller.rs Refactor let_chains usage to nested if.
components/raftstore/src/store/worker/split_check.rs Refactor let_chains usage to nested if (adds explicit init path).
components/raftstore/src/store/util.rs Refactor let_chains usage to nested if.
components/raftstore/src/store/simple_write.rs Replace debug_assert_matches! with debug_assert!(matches!(...)).
components/raftstore/src/store/fsm/peer.rs Refactor let_chains usage to nested if.
components/raftstore/src/store/async_io/write.rs Refactor let_chains usage to nested if.
components/raftstore/src/lib.rs Remove #![feature(let_chains)].
components/raftstore/src/coprocessor/region_info_accessor.rs Refactor let_chains usage to nested if.
components/raftstore/src/coprocessor/config.rs Replace let_chains control flow with match to keep logic.
components/raftstore-v2/src/worker/tablet.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/unsafe_recovery/report.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/unsafe_recovery/force_leader.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/unsafe_recovery/destroy.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/unsafe_recovery/demote.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/unsafe_recovery/create.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/ready/snapshot.rs Replace assert_matches! with assert!(matches!(...)) and refactor let_chains.
components/raftstore-v2/src/operation/ready/mod.rs Refactor multi-let chain into tuple match.
components/raftstore-v2/src/operation/ready/apply_trace.rs Refactor let_chains usage to nested if with early return.
components/raftstore-v2/src/operation/query/capture.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/misc.rs Refactor let_chains around send/shutdown handling.
components/raftstore-v2/src/operation/life.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/command/write/ingest.rs Refactor let_chains around send/shutdown handling.
components/raftstore-v2/src/operation/command/mod.rs Refactor let_chains usage to nested if (and move perf reporting into block).
components/raftstore-v2/src/operation/command/admin/mod.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/command/admin/merge/rollback.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/command/admin/merge/prepare.rs Refactor let_chains; introduces unconditional merge_context_mut() call.
components/raftstore-v2/src/operation/command/admin/merge/mod.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/operation/command/admin/merge/commit.rs Refactor let_chains usage to nested if with early return.
components/raftstore-v2/src/operation/command/admin/compact_log.rs Refactor let_chains usage to nested if.
components/raftstore-v2/src/lib.rs Remove #![feature(let_chains)].
components/raftstore-v2/src/fsm/store.rs Refactor let_chains (introduces logic regression in set_region).
components/raftstore-v2/src/batch/store.rs Refactor let_chains usage to nested if.
components/pd_client/src/lib.rs Remove #![feature(let_chains)].
components/in_memory_engine/src/write_batch.rs Refactor let_chains usage to nested if.
components/in_memory_engine/src/region_stats.rs Refactor let_chains usage to nested if.
components/in_memory_engine/src/region_manager.rs Replace assert_matches! with assert!(matches!(...)) and refactor let_chains.
components/in_memory_engine/src/lib.rs Remove #![feature(let_chains)].
components/in_memory_engine/src/background.rs Refactor let_chains usage to nested if.
components/hybrid_engine/src/observer/load_eviction.rs Refactor let_chains usage to nested if.
components/hybrid_engine/src/lib.rs Remove #![feature(let_chains)].
components/engine_traits/src/lib.rs Remove #![feature(let_chains)].
components/engine_test/src/lib.rs Remove #![feature(let_chains)] and refactor let_chains.
components/engine_rocks/src/util.rs Refactor let_chains usage to nested if / early returns.
components/engine_rocks/src/rocks_metrics.rs Refactor let_chains usage to nested if.
components/engine_rocks/src/raft_engine.rs Refactor let_chains usage to nested if.
components/engine_rocks/src/misc.rs Refactor let_chains usage to nested if.
components/engine_rocks/src/lib.rs Remove #![feature(let_chains)].
components/encryption/src/manager/mod.rs Refactor let_chains usage to nested if.
components/encryption/src/lib.rs Remove #![feature(let_chains)].
components/crossbeam-skiplist/src/base.rs Adjust unsafe tower indexing to satisfy newer compiler constraints.
cmd/tikv-ctl/src/main.rs Remove #![feature(let_chains)].
cmd/tikv-ctl/src/executor.rs Refactor let_chains usage to nested if.
clippy.toml Move clippy config keys to top of file.
Cargo.toml Add [patch] override for raft-engine to fork/branch.
Cargo.lock Update locked versions (notably time to 0.3.47, chrono, serde, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@Cargo.toml`:
- Around line 229-230: The Cargo.toml patch overrides raft-engine with a
personal fork (raft-engine = { git = "https://github.com/v01dstar/raft-engine",
branch = "update-serde" }), which must be temporary; update the patch to point
back to the official tikv/raft-engine repo once upstream PR tikv/raft-engine#390
is merged (or remove the patch entirely), and add a clear TODO comment next to
this patch referencing the upstream PR and the requirement to revert to official
sources to avoid supply-chain risk—mirror the style of the existing TODO around
the nearby lines (226-227) so reviewers can track the temporary override and the
condition for its removal.

In `@components/raftstore-v2/src/operation/command/admin/compact_log.rs`:
- Around line 534-546: The code currently sets last_compacted_idx even when
store_ctx.engine.gc(...) fails; change the flow in compact_log handling so that
after calling store_ctx.engine.gc(self.region_id(), 0, index,
self.state_changes_mut()) you only call
self.compact_log_context_mut().set_last_compacted_idx(index) when gc returns Ok
— i.e., move the set_last_compacted_idx call into the success branch (after the
call completes without Err) and leave it unchanged when Err(e) is returned
(keeping the error! logging in the Err arm using error!(... "err" => ?e)).
Ensure you still obtain index via self.compact_log_index() and preserve the
surrounding checks against storage().apply_trace().persisted_apply_index().

In `@rust-toolchain.toml`:
- Line 3: The rust-toolchain bump in rust-toolchain.toml (channel =
"nightly-2026-01-30") needs verification by running the standard lint/dev flow;
run `make clippy` to ensure the RUSTSEC fix and removal of let-chains produce no
warnings/errors, and if you want full checks run `make dev` to include
formatting + clippy; fix any resulting clippy or formatting failures (in the
crate modules, functions, or files changed by this toolchain bump) until both
commands succeed.

In `@src/server/raftkv/raft_extension.rs`:
- Around line 67-70: The current change only calls
self.router.send_raft_msg(msg) when key_message is true, which drops non-key
raft messages; change it so send_raft_msg is always called but keep the
conditional logging for key messages: always invoke
self.router.send_raft_msg(msg) and if it returns Err(e) then, if key_message is
true, call error! with region_id, msg_ty and err => ?e (preserve existing
contextual fields), otherwise swallow/ignore the error as before; update the
block around the key_message check and the send_raft_msg call (referencing the
key_message variable, self.router.send_raft_msg, and the existing error handling
identifiers region_id, msg_ty, and e).
🧹 Nitpick comments (3)
components/in_memory_engine/src/background.rs (1)

1296-1339: Indentation of the inner block appears off after the refactor.

The body (lines 1298–1337) was originally at the correct indent level for a single combined if. After splitting into two nested ifs, the body should be indented one additional level under the inner if let Some(e) = &self.rocks_engine. Please run make format to fix the indentation. As per coding guidelines, "Use make format to run code formatter for Rust source code".

components/raftstore-v2/src/operation/unsafe_recovery/destroy.rs (1)

11-20: Indentation of the inner block needs adjustment.

Lines 13–18 should be indented one more level inside the if !state.is_abort() block. Please run make format. As per coding guidelines, "Use make format to run code formatter for Rust source code".

components/raftstore-v2/src/operation/unsafe_recovery/report.rs (1)

30-39: Same indentation issue as other refactored files.

Lines 32–37 should be indented one more level under if !state.is_abort(). Please run make format. As per coding guidelines, "Use make format to run code formatter for Rust source code".

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@components/raftstore-v2/src/fsm/store.rs`:
- Around line 66-99: The code currently only inserts into self.region_ranges
when prev is Some, so newly added initialized regions (prev == None) are never
recorded; move the insertion of (data_end_key(region.get_end_key()), version) ->
region_id out of the if let Some(prev) block so that if initialized is true you
always call self.region_ranges.insert(...) (use the existing initialized check
and the same assertion used now), keeping the existing prev-handling logic (the
asserts on prev_init and epoch/version checks) unchanged; update the block
around region_ranges.insert in the function where region, version, region_id,
initialized, data_end_key, and self.region_ranges are referenced to perform the
insert unconditionally when initialized is true.

@LykxSassinator
Copy link
Copy Markdown
Contributor

LykxSassinator commented Feb 12, 2026

Since rustc 1.88.0 stable has made let_chains stablized, how about directly upgrading the rustc and remove feature(let_chains) ?

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/server/raftkv/raft_extension.rs`:
- Around line 67-73: Remove the stray extra closing brace that causes a syntax
error: locate the block where self.router.send_raft_msg(msg) is called and the
subsequent if key_message { … } logging branch (references: method
send_raft_msg, variable self.router, variable key_message, and msg_ty/region_id
logging) and delete the redundant `}` after that block so the braces for the if
let Err(e) and the if key_message match correctly.

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
@v01dstar
Copy link
Copy Markdown
Member Author

Since rustc 1.88.0 stable has made let_chains stablized, how about directly upgrading the rustc and remove feature(let_chains) ?

Rustc is already upgrade in this PR, and feature(let_chains)s are removed. The thing is that rustc 1.88+ not only stabilize let_chain but also disallow us using let_chain unless we set edition = 2024. We have to set edition = 2024 if we want to use let_chain, however, like I mentioned in the PR description, it is a larger change doing that. 2024 edition has some styling changing over borrow/lifetime declaration, it is nearly impossible to review doing it all at once for TiKV project, that's why I recommended just deprecate let_chain to fix the CI, and then migrate the whole TiKV project to 2024 edition gradually later

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
@v01dstar v01dstar changed the title *: Update time crate, and all its dependencies *: Update rustc to update time crate Feb 12, 2026
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 13, 2026
Copy link
Copy Markdown
Contributor

@glorv glorv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw in some modules, it replaces if-let-chains with nested if blocks, please investigate the root cause and revert these changes.

rest LGTM

let time =
std::time::Instant::now() + limiter.consume_duration(1);
let _ = GLOBAL_TIMER_HANDLE.delay(time).compat().await;
if let Some(mut t) = registry.get(r) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw many other changes are "replacing nested if with let-chains", but why here it replaced the if-let-chains back to nested if blocks?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on whether we "can" set a specific module's edition to 2024 in its Cargo.toml. After upgrading Rust nightly, to use let_chains, we have to set edition to 2024, feature(let_chains) no longer work. I set some of the modules to use 2024 edition, if the module requires minimum changes. For some modules like raftstore, setting edition to 2024 also force us to do massive styling changes related to borrow/lifetime, thats why I created a separate issue to track this in this PR's description

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 14, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Feb 14, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-13 09:15:16.372135159 +0000 UTC m=+684.118529190: ☑️ agreed by gengliqi.
  • 2026-02-14 02:44:21.649108968 +0000 UTC m=+63629.395503000: ☑️ agreed by glorv.

Copy link
Copy Markdown
Member

@zhangjinpeng87 zhangjinpeng87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Feb 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, glorv, zhangjinpeng87

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Feb 15, 2026
@ti-chi-bot ti-chi-bot bot merged commit 12b2ab2 into tikv:master Feb 15, 2026
10 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Feb 15, 2026
@you06
Copy link
Copy Markdown
Contributor

you06 commented Feb 24, 2026

There is the same clippy failure in release-8.5 branch. Shall we pick this PR to 8.5 or just ignore the "RUSTSEC-2026-0009" in release-8.5's deny.toml?

mittalrishabh pushed a commit to mittalrishabh/tikv that referenced this pull request Mar 7, 2026
close tikv#19355

Update time crate to fix RUSTSEC-2026-0009.

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
mittalrishabh pushed a commit to mittalrishabh/tikv that referenced this pull request Mar 7, 2026
close tikv#19355

Update time crate to fix RUSTSEC-2026-0009.

Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
Signed-off-by: rishabh mittal <mittalrishabh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clippy failed due to RUSTSEC-2026-0009

8 participants