[YSQL] Provide a spanner-like behavior to wait out the clock skew at commit time. #22317
Open
1 task done
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-11226
Description
Context
We use hybrid timestamping mechanism to decide ordering between commits and reads. But this is problematic since clocks are skewed in a distributed database such as YB. This skew can be mitigated in two ways,
YB uses approach 2, since approach 1 is too expensive when clock skews are high. The clock skews have gotten as large as 500ms in the past.
Motivation
However, times have changed, and clouds now provide services to get highly accurate clocks. For example, AWS provides announced microsecond-accurate clocks in their recent changes to AWS Time Sync Service.
In the presence of such accurate clocks, we wish to employ a spanner-like approach (approach 1). This has a couple of advantages
Objective
Explore AWS Time Sync Service. Use AWS Nitro system, configure PTP hardware clocks and use tight update intervals to see how good we can bound the clock skew. This AWS blog mentions that the clock error is typically bounded by 40us. Even with NTP (not PTP), we should get a 100us time. This is very much acceptable.
I have also noticed that ntp_adjtime gives an error that is couple orders of magnitude higher than what chrony gives us. Use aws clock bound implementation as a reference.
This cannot be a runtime flag because of changes in hyrbid time values. Ideally, this is an AUTO FLAG.
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: