Commit Graph

13 Commits

Author SHA1 Message Date
Aaron Son
9b763af5a6 libraries/utils/async/ring_buffer.go: PR feedback. Return error on epoch mismatch. 2021-03-24 15:45:58 -07:00
Aaron Son
b77f2bad8c go/libraries/doltcore/sqle/async_indexed_lookups.go: Fix leaking of results from one index lookup to another.
When a query with an index lookup as a LIMIT, it's possible for the result
iterator to be closed before all the index results have been streamed. When
that happens, we can end up with queueRows goroutine which is enqueuing rows
into a ring buffer that is going to be used by a different query later.

This PR adds two mechanisms, one to stop the wrong results from being seen and
to cancel the unnecessary work.

1. RingBuffer gets an epoch, which is incremented on each Reset(). If a given
   Push does not match the current epoch, then nothing is added to the ring
   buffer.

2. queueRows is run with a cancelable (sub-)Context, and that Context is
   canceled when the corresponding iterator is Closed().
2021-03-24 14:11:09 -07:00
Brian Hendriks
69de83a757 Fixed worker pool used for index lookups (#1304) 2021-02-16 17:28:20 -08:00
Aaron Son
8f2414ee1e go/libraries/util/async/errgroup{,_test}.go: Update copyright headers for Dolthub. 2020-11-02 11:09:44 -08:00
Aaron Son
eb96988abb Merge remote-tracking branch 'origin/master' into aaron/diff-summary-error-handling 2020-11-02 11:07:55 -08:00
Aaron Son
84c3066348 go/**/*.go: Update copyright headers for company name change. 2020-11-02 10:17:02 -08:00
Aaron Son
87f5333fa6 go/libraries/utils/async: Fix copyright headers in errgroup{,_test}.go 2020-11-02 10:03:14 -08:00
Aaron Son
3fef3fdaaf Merge remote-tracking branch 'origin/master' into aaron/diff-summary-error-handling 2020-11-02 08:40:20 -08:00
Aaron Son
c8750708b7 go/libraries/utils/async: Have ActionExecutor use sync.WaitGroup. 2020-11-01 06:47:04 -08:00
Aaron Son
4fcae36a50 go/libraries/utils/async: Add small utility, GoWithCancel. 2020-10-31 08:29:15 -07:00
Daylon Wilkins
7b852f47e6 Fixed ActionExecutor causing duplicate key error loop 2020-09-14 10:31:53 -07:00
Brian Hendriks
d84fe9af41 add ReadAheadTableReader.go (#847) 2020-08-31 11:16:50 -07:00
Daylon Wilkins
2fa2b8fd63 Heavily improved SQL write performance 2020-06-02 17:45:00 -07:00