mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
add the error-out-on-already-errored behavior documented in design doc
This commit is contained in:
parent
4c74df6eec
commit
c6baf051b8
1 changed files with 8 additions and 0 deletions
|
|
@ -980,9 +980,14 @@ func (rq *rbfQueryContext) Flush(index keys.Index, shard keys.Shard) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
var errAlreadyErrored = errors.New("query context previously encountered an error")
|
||||
|
||||
func (rq *rbfQueryContext) Read(index keys.Index, field keys.Field, view keys.View, shard keys.Shard) (QueryRead, error) {
|
||||
rq.mu.Lock()
|
||||
defer rq.mu.Unlock()
|
||||
if rq.err != nil {
|
||||
return nil, errAlreadyErrored
|
||||
}
|
||||
dbk, fk := rq.txStore.keys(index, field, view, shard)
|
||||
queries, ok := rq.queries[dbk]
|
||||
if !ok {
|
||||
|
|
@ -1014,6 +1019,9 @@ func (rq *rbfQueryContext) Write(index keys.Index, field keys.Field, view keys.V
|
|||
}
|
||||
rq.mu.Lock()
|
||||
defer rq.mu.Unlock()
|
||||
if rq.err != nil {
|
||||
return nil, errAlreadyErrored
|
||||
}
|
||||
queries, ok := rq.queries[dbk]
|
||||
if !ok {
|
||||
var err error
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue