Skip to content
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

sql: logic_test/crdb_internal: add missing comments #38078

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions pkg/sql/logictest/testdata/logic_test/crdb_internal
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,31 @@ subtest max_retry_counter
statement ok
SET application_name = 'test_max_retry'

# Make the statement retry, to ensure max_retries increases to
# become different from 0.
# The delay is chosen identically to the value in the `txn`
# logic tests introduced in #16719. It is long enough
# to ensure max_retries increases, even under stress,
# but short enough to be negligible compared to the
# overall test suite.
statement OK
SELECT crdb_internal.force_retry('50ms'::INTERVAL)

statement OK
RESET application_name

# Note: two rows of output are expected: one for the statement that
# failed with a retry error, and one for the final retry attempt that
# succeeded without an error.
# We also expect the RESET statement to not have any retry.
# This tests that the retry counter is properly reset to 0
# between statements.
# Note: in the following test, three rows of output are expected:
# - one for the SELECT statements that failed with a retry error,
# - one for the final SELECT retry attempt that succeeded without an error,
# - one for the RESET statement.
#
# We expect the first two entries to have max_retries > 0 because
# auto-retries are expected by the server.
# We also expect the RESET statement to have max_retries = 0, because
# RESET never retries. This tests that the retry counter is properly
# reset to 0 between statements - a naive implementation could make
# the counter increase forever, even between statements.
#
query TBB
SELECT key, (max_retries > 0), flags LIKE '!%' AS f
FROM crdb_internal.node_statement_statistics
Expand Down