-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvserver: get TestRaftCheckQuorum working with leader leases
Epic: CRDB-8035 Release note: None
- Loading branch information
1 parent
d603c40
commit e19016b
Showing
12 changed files
with
245 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pkg/kv/kvserver/storeliveness/unreliable_store_liveness_handler.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package storeliveness | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/kv/kvserver/storeliveness/storelivenesspb" | ||
|
||
type UnreliableHandlerFuncs struct { | ||
DropStoreLivenessMsg func(*storelivenesspb.Message) bool | ||
} | ||
|
||
// UnreliableHandler drops all StoreLiveness messages that are addressed to | ||
// the specified storeID, but lets all other messages through. | ||
type UnreliableHandler struct { | ||
Name string | ||
MessageHandler | ||
UnreliableHandlerFuncs | ||
} | ||
|
||
var _ MessageHandler = &UnreliableHandler{} | ||
|
||
// HandleMessage implements the MessageHandler interface. | ||
func (h *UnreliableHandler) HandleMessage(msg *storelivenesspb.Message) error { | ||
if h.DropStoreLivenessMsg(msg) { | ||
return nil | ||
} | ||
|
||
return h.MessageHandler.HandleMessage(msg) | ||
} |
Oops, something went wrong.