sync request ownership
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 2m8s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 2m8s
This commit is contained in:
@@ -319,9 +319,11 @@ func (p *SyncedPool) RequestOwnership(id CartId) error {
|
||||
ok++
|
||||
}
|
||||
if ok == 0 && all > 0 {
|
||||
delete(p.local.grains, id)
|
||||
return fmt.Errorf("no remotes confirmed change")
|
||||
}
|
||||
if ok < (all / 2) {
|
||||
delete(p.local.grains, id)
|
||||
return fmt.Errorf("quorum not reached")
|
||||
}
|
||||
return nil
|
||||
@@ -435,10 +437,7 @@ func (p *SyncedPool) getGrain(id CartId, requestOwnership bool) (Grain, error) {
|
||||
return remoteGrain, nil
|
||||
}
|
||||
if requestOwnership {
|
||||
err = p.RequestOwnership(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
go p.RequestOwnership(id)
|
||||
}
|
||||
localGrain, err = p.local.GetGrain(id)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user