[#22537] YSQL: Benchmark restart read requests metric. #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
YugabyteDB provides read-after-commit-visibility guarantee as described by the
read restart error
section in Yugabyte Docs. This guarantee prevents the stale read anomaly and we need a mechanism to detect stale reads. Moreover, several optimizations are introduced into the database to reduce the number ofread restart error
s, and it is desirable to have benchmarks that demonstrate these improvements.Changes
Stale read detection example
Cluster Setup
To reproduce stale reads,
a. Use replication_factor=1
b. Use a single zone.
c. heartbeat_interval_ms=10000
T-Server GFlags
a. max_clock_skew_usec=0
b. fail_on_out_of_range_clock_skew=false
c. clock_skew_force_crash_bound_usec=0
a. sudo systemctl stop chronyd
b. sudo timedatectl set-ntp false
c. sudo date -s "$(date -d '+0.4 seconds' '+%Y-%m-%d %H:%M:%S')"
As a final step, verify the clock skew between the cluster nodes using the /tablet-server-clocks page of the WebUI.
Command
$ java -jar target/yb-sample-apps.jar --workload SqlStaleReadDetector --nodes x.x.x.x:5433,y.y.y.y:5433,z.z.z.z:5433 >& ../temp.log
Sample log output