Skip to content

Add ttl for raw client#324

Merged
andylokandy merged 2 commits into
tikv:masterfrom
andylokandy:master
Dec 28, 2023
Merged

Add ttl for raw client#324
andylokandy merged 2 commits into
tikv:masterfrom
andylokandy:master

Conversation

@andylokandy

@andylokandy andylokandy commented Dec 7, 2021

Copy link
Copy Markdown
Collaborator

Signed-off-by: andylokandy andylokandy@hotmail.com

  • Implementation
  • Manual test
  • Add docs

closes ##370

@andylokandy andylokandy requested a review from ekexium December 7, 2021 16:19
@jiashiwen

Copy link
Copy Markdown

This is the feature I need

@ekexium ekexium left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need some doc comments. Others LGTM.

Comment thread src/raw/lowering.rs Outdated
@supercmmetry

Copy link
Copy Markdown

I really really need this feature!!

Is there a reason why this PR was not merged / worked upon anymore?

@andylokandy

Copy link
Copy Markdown
Collaborator Author

Oh, it was just forgotten.

Signed-off-by: Andy Lok <andylokandy@hotmail.com>
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
@andylokandy andylokandy merged commit 6f9c133 into tikv:master Dec 28, 2023
pingyu pushed a commit to pingyu/client-rust that referenced this pull request Jan 25, 2026
* Add ttl for raw client

Signed-off-by: Andy Lok <andylokandy@hotmail.com>

* fmt

Signed-off-by: Andy Lok <andylokandy@hotmail.com>

---------

Signed-off-by: Andy Lok <andylokandy@hotmail.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
eduralph added a commit to getwyrd/client-rust that referenced this pull request Jul 15, 2026
…revision

The vendored protos were an unrecorded late-2023/early-2024 vintage (errorpb
and pdpb untouched since tikv#324, one hand-patched addition from tikv#519). Re-vendor
everything at pingcap/kvproto b41e86365ce0 — the revision client-go currently
pins — and add proto/VERSION so the vintage is never again guesswork.

Regenerated with the existing tonic-build pipeline (21 files). One mechanical
source fix: pdpb.RequestHeader gained caller_component/caller_id.

Two new protocol semantics arrive with the refresh and are handled rather than
silently mis-parsed:

1. errorpb.UndeterminedResult (an unknown raft apply outcome). The transport
   never retries it in client-go (region_request.go: 'should not retry ...
   processed by the caller'); each action decides. Here: the plan layer retries
   by default (replaying an idempotent request resolves the uncertainty, and
   the error escapes UNCHANGED on backoff exhaustion), while plans for which a
   replay is unsafe are terminal on first sight — raw CAS (a replay would
   compare against its own effect and report a false failure), the primary
   commit (client-go returns ErrResultUndetermined there, commit.go), and
   async-commit/1PC prewrites (the commit point; stricter than client-go, in
   the safe direction). Commit paths classify the surfaced error as
   UndeterminedError: at a commit point, 'failed' must never be claimed when
   the transaction may already be durable.

2. Shared locks (SharedLock / SharedPessimisticLock, whose real holders live
   in shared_lock_infos — 'DO NOT read from the wrapper LockInfo'). This
   client does not implement shared-lock resolution yet, and partial handling
   is worse than none (resolving the wrapper checks transaction 0; filtering
   on wrapper fields silently drops members). Resolution therefore REFUSES
   them with an explicit error, before any filter. The API-v2 keyspace codecs
   are wrapper-aware (identifying wrappers by TYPE — the empty logical key is
   valid — and recursing into members), so scan results can never panic the
   truncation path.

Tests: 67 lib tests (4 new: undetermined terminal/preserved/recognized,
shared-lock refusal); txn/raw/failpoint integration suites green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Eduard R. <eduard@ralphovi.net>
eduralph added a commit to getwyrd/client-rust that referenced this pull request Jul 15, 2026
…revision

The vendored protos were an unrecorded late-2023/early-2024 vintage (errorpb
and pdpb untouched since tikv#324, one hand-patched addition from tikv#519). Re-vendor
everything at pingcap/kvproto b41e86365ce0 — the revision client-go currently
pins — and add proto/VERSION so the vintage is never again guesswork.

Regenerated with the existing tonic-build pipeline (21 files). One mechanical
source fix: pdpb.RequestHeader gained caller_component/caller_id.

Two new protocol semantics arrive with the refresh and are handled rather than
silently mis-parsed:

1. errorpb.UndeterminedResult (an unknown raft apply outcome). The transport
   never retries it in client-go (region_request.go: 'should not retry ...
   processed by the caller'); each action decides. Here: the plan layer retries
   by default (replaying an idempotent request resolves the uncertainty, and
   the error escapes UNCHANGED on backoff exhaustion), while plans for which a
   replay is unsafe are terminal on first sight — raw CAS (a replay would
   compare against its own effect and report a false failure), the primary
   commit (client-go returns ErrResultUndetermined there, commit.go), and
   async-commit/1PC prewrites (the commit point; stricter than client-go, in
   the safe direction). Commit paths classify the surfaced error as
   UndeterminedError: at a commit point, 'failed' must never be claimed when
   the transaction may already be durable.

2. Shared locks (SharedLock / SharedPessimisticLock, whose real holders live
   in shared_lock_infos — 'DO NOT read from the wrapper LockInfo'). This
   client does not implement shared-lock resolution yet, and partial handling
   is worse than none (resolving the wrapper checks transaction 0; filtering
   on wrapper fields silently drops members). Resolution therefore REFUSES
   them with an explicit error, before any filter. The API-v2 keyspace codecs
   are wrapper-aware (identifying wrappers by TYPE — the empty logical key is
   valid — and recursing into members), so scan results can never panic the
   truncation path.

Tests: 67 lib tests (4 new: undetermined terminal/preserved/recognized,
shared-lock refusal); txn/raw/failpoint integration suites green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Eduard R. <eduard@ralphovi.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants