Skip to content

Commit

Permalink
Merge #41577 #41579
Browse files Browse the repository at this point in the history
41577: storage: Deflake TestReplicateRogueRemovedNode r=ajwerner a=bdarnell

Some recently-refactored test harness code needed to check for nil
stores.

Fixes #41466

Release note: None

41579: sqlsmith: fix merge join to exit when it's out of indexes r=mjibson a=mjibson

Release note: None

Co-authored-by: Ben Darnell <[email protected]>
Co-authored-by: Matt Jibson <[email protected]>
  • Loading branch information
3 people committed Oct 14, 2019
3 parents aa1bfce + 8315fd5 + a146781 commit c07449d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkg/internal/sqlsmith/relational.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ func makeMergeJoinExpr(s *Smither, _ colRefs, forJoin bool) (tree.TableExpr, col
item: tree.NewColumnItem(rightAliasName, rightColElem.Column),
},
})
if len(cols) >= len(leftIdx.Columns) {
break
}
}
if len(cols) > 0 {
return rightTableName, cols
Expand Down
18 changes: 15 additions & 3 deletions pkg/storage/client_raft_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,31 @@ func (h *mtcStoreRaftMessageHandler) HandleRaftRequest(
req *storage.RaftMessageRequest,
respStream storage.RaftMessageResponseStream,
) *roachpb.Error {
return h.mtc.Store(h.storeIdx).HandleRaftRequest(ctx, req, respStream)
store := h.mtc.Store(h.storeIdx)
if store == nil {
return roachpb.NewErrorf("store not found")
}
return store.HandleRaftRequest(ctx, req, respStream)
}

func (h *mtcStoreRaftMessageHandler) HandleRaftResponse(
ctx context.Context, resp *storage.RaftMessageResponse,
) error {
return h.mtc.Store(h.storeIdx).HandleRaftResponse(ctx, resp)
store := h.mtc.Store(h.storeIdx)
if store == nil {
return errors.New("store not found")
}
return store.HandleRaftResponse(ctx, resp)
}

func (h *mtcStoreRaftMessageHandler) HandleSnapshot(
header *storage.SnapshotRequest_Header, respStream storage.SnapshotResponseStream,
) error {
return h.mtc.Store(h.storeIdx).HandleSnapshot(header, respStream)
store := h.mtc.Store(h.storeIdx)
if store == nil {
return errors.New("store not found")
}
return store.HandleSnapshot(header, respStream)
}

// mtcPartitionedRange is a convenient abstraction to create a range on a node
Expand Down

0 comments on commit c07449d

Please sign in to comment.