-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YCQL] TTL enforcement delayed when non-default (weaker) read-consistency is used #2394
Comments
Root cause: in case of Consistency Level == 'One' (== YB_CONSISTENT_PREFIX) any tablet replica can be used to get READ (SELECT) request result. So, any FOLLOWER (non-leader replica) can be used to process the read request. When the read request is processed by Leader (in case of Consistency Level == QUORUM == YB_STRONG) the read time is correct. But if the request is processed by a Follower - the read time is invalid. In case of 9 sec pause between write and read I see in the logs the following time values.
So MvccManager::SafeTimeForFollower provides invalid (9 sec in past) read time, while the MvccManager::SafeTime returns correct value. |
Stack trace:
|
In logs:
|
Implementation:
Use |
@OlegLoginov: |
On the slack channel, a user reported an issue with a program using
Consistency(gocql.One)
and TTL enforcement for a sample Golang test program with YCQL using gocql driver.With defaults (i.e. strong read consistency), Consistency(gocql.Quorum), the issue doesn't arise.
Even with the weaker
gocql.One
the issue seems to be transient. When the tablet/shard gets additional writes (to even unrelated keys) after an item has expired, then the value is correctly deemed as expired.So in practice impact of issue is minimal, and the values will get purged in due course. Nevertheless, we'll look into what's causing the delay in enforcement for the read consistency level One.
Sample test case:
https://gist.github.com/kmuthukk/f182837117f7af553a0d500c54e89ee3
To run:
Note:
is changed to use default consistency (quorum)
or
The text was updated successfully, but these errors were encountered: