-
Notifications
You must be signed in to change notification settings - Fork 222
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
function RawCAS do not expose parameter 'ttl' #371
Comments
Thanks @tutububug I think it is a good idea. |
For now, CAS with TTL is forbidden but removing this restriction should be fine, the next few pull requests for API v2 should fix this. |
@iosmanthus |
For now, TiKV v5.4.0 has canceled this restriction, but client-go need modify some method signature to support this feature by add a |
ok, thank you. I had forked repository of client-go to modify method signature.
…-------- 原始邮件 --------
发件人: iosmanthus ***@***.***>
日期: 2022年2月22日周二 15:58
收件人: tikv/client-go ***@***.***>
抄送: tutububug ***@***.***>, Mention ***@***.***>
主 题: Re: [tikv/client-go] function RawCAS do not expose parameter 'ttl' (Issue #371)
@iosmanthus<https://github.com/iosmanthus> Do you have any update for the issue?
For now, TiKV v5.4.0 has canceled this restriction, but client-go need modify some method signature to support this feature by add a Ttl parameter to grpc request.
―
Reply to this email directly, view it on GitHub<#371 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJU3HUGMHQATOYRGUG7JEO3U4M62TANCNFSM5H2FF3ZA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
In go-client V2, the function
As far as I know, tikv splices ttl in value and uses it as a compaction filter to delete the key after the life cycle. reqArgs := kvrpcpb.RawCASRequest{
Key: key,
Value: newValue,
}
if previousValue == nil {
reqArgs.PreviousNotExist = true
} else {
reqArgs.PreviousValue = previousValue
}
req := tikvrpc.NewRequest(tikvrpc.CmdRawCompareAndSwap, &reqArgs)
req.MaxExecutionDurationMs = uint64(client.MaxWriteExecutionTime.Milliseconds())
resp, _, err := c.sendReq(ctx, key, req, false) Can I add new ttl to RawCASRequest? Also what can be done to update the value using CAS and keep the historical ttl?@iosmanthus |
hi, I raise a PR #943 to fix this. @iosmanthus |
in kvproto project, RawCASRequest defined and include the 'ttl' member, and tikv-server also deal the request with 'ttl' semantic.
why does not exposed it to the client api? CAS with ttl seems very useful in many cases.
The text was updated successfully, but these errors were encountered: