Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
59330: sql: make internal executor streaming r=yuzefovich a=yuzefovich

This commit updates the internal executor to operate in a streaming
fashion by refactoring its internal logic to implement an iterator
pattern. A new method `QueryInternalEx` (and its counterpart
`QueryInternal`) is introduced (both not used currently) while all
existing methods of `InternalExecutor` interface are implemented
using the new iterator logic.

The communication between the iterator goroutine (the receiver) and the
connExecutor goroutine (the sender) is done via a buffered (of 32 size
in non-test setting) channel. The channel is closed when the
connExecutor goroutine exits its run() loop.

Care needs to be taken when closing the iterator - we need to make sure
to close the stmtBuf (so that there are no more commands for the
connExecutor goroutine to execute) and then we need to unblockingly
drain the channel (since the connExecutor goroutine might be blocked on
adding a row to the channel). After that we have to wait for the
connExecutor goroutine to exit so that we can finish the tracing span.
For convenience purposes, if the iterator is fully exhausted, it will
get closed automatically.

Addresses: #48595.

Release note: None

60023: kv: wait for replica initialization in closed timestamp tests r=nvanbenschoten a=nvanbenschoten

Fixes #60288.

This commit updates tests in closed_timestamp_test.go to wait for
replica initialization before returning replicas in `replsForRange`.
This was causing flakiness on master. I bisected it back to c44b357. It
appears that that change allowed for calls directly to `Replica.Send`
(testing only) to make it deeper into replica code and eventually hit a
panic in `Replica.checkSpanInRangeRLocked`.

This commit fixes this in two ways:
1. it updates the closed timestamp tests to wait for replica
   initialization before calling directly into `Replica.Send`. Tests
   shouldn't be calling `Replica.Send` on uninitialized replicas.
2. it adds extra protection in `Replica.checkExecutionCanProceed` to throw
   an error if the replica is no initialized. This isn't strictly
   necessary, but it's cheap and limits the blast radius of getting this
   wrong elsewhere.

Release note: None

60282: delegate: gate estimated_row_count on SHOW TABLES behind cluster setting r=rafiss a=otan

 Refs: #58189

Release note (sql change): Introduced a cluster setting
sql.show_tables.estimated_row_count.enabled, which defaults to true. If
false, estimated_row_count will not display on SHOW TABLES which
improves performance.

60285: geo/wkt: add support for parsing multilinestrings with Z and M dims r=otan a=andyyang890

This patch extends the capabilities of the WKT parser to include
parsing of multilinestrings with Z and M dimensions.

Refs: #53091

Release note: None

60305: sql: use kv_node_status to determine node liveness for multiregion r=arulajmani a=otan

This was a relic before the decision was made -- node liveness was
detected by gossip instead. This changes the code to use SHOW REGIONS
FROM CLUSTER, which aggregates from kv_node_status.

Release note: None

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Co-authored-by: Andy Yang <ayang@cockroachlabs.com>
  • Loading branch information
5 people committed Feb 10, 2021
6 parents 9f1d67a + 178239e + fd5026f + 144c81a + 03a2b46 + f9fa9c6 commit aaa8c54
Show file tree
Hide file tree
Showing 19 changed files with 1,243 additions and 478 deletions.
8 changes: 8 additions & 0 deletions pkg/geo/wkt/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ func getKeywordToken(tokStr string) int {
return MULTIPOINTZ
case "MULTIPOINTZM":
return MULTIPOINTZM
case "MULTILINESTRING":
return MULTILINESTRING
case "MULTILINESTRINGM":
return MULTILINESTRINGM
case "MULTILINESTRINGZ":
return MULTILINESTRINGZ
case "MULTILINESTRINGZM":
return MULTILINESTRINGZM
default:
return eof
}
Expand Down
Loading

0 comments on commit aaa8c54

Please sign in to comment.