mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-10 15:01:03 +00:00
translate data: only redirect to UNKNOWN node if there is no STARTED
caveat: this will always redirect to the first UNKNOWN node... possibly we would want to select randomly or have the ability to retry different nodes.
This commit is contained in:
parent
f7651e3a26
commit
cb4f23fc98
1 changed files with 7 additions and 2 deletions
9
api.go
9
api.go
|
|
@ -867,10 +867,15 @@ func (api *API) TranslateData(ctx context.Context, indexName string, partition i
|
|||
var upNode *topology.Node
|
||||
for _, node := range nodes {
|
||||
// we all UNKNOWN state here because we often mistakenly think
|
||||
// a node is not up under heavy load.
|
||||
if node.State == disco.NodeStateStarted || node.State == disco.NodeStateUnknown {
|
||||
// a node is not up under heavy load, but prefer STARTED if we
|
||||
// find one.
|
||||
if node.State == disco.NodeStateStarted {
|
||||
upNode = node
|
||||
break
|
||||
} else if node.State == disco.NodeStateUnknown {
|
||||
if upNode != nil {
|
||||
upNode = node
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue