Skip to content

sql/kv: block queries with more than productionKVBatchSize batches from being serviced by bounded staleness #69063

@otan

Description

@otan

Before #69062, families with randomise in logic tests. This sometimes causes a multiple-batch fetch (when the batch size is >= productionKVBatchSize batches, 1 in logic tests) in pkg/sql/row/kv_batch_fetcher.go, which calls NegotiateAndSend twice. As a result, we would hit the txn commit timestamp must not be fixed assertion in checkNegotiateAndSendPreconditions.

It feels like we should exit out of the bounded staleness read if we detect this, or opt-out cross-column family bounded staleness reads.

Reproduction steps: #69063 (comment)

I can't get a consistent reproduction of this; reverting #69062 and running while make testccllogic FILES='as_of'; do :; done locally on my mac will fail within 10-20 runs on this line:

SELECT * FROM t AS OF SYSTEM TIME with_max_staleness('1ms') WHERE i = 2

cc @rytaft @nvanbenschoten

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions