Compare commits
2 Commits
d481bcdc77
...
173c4d3151
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
173c4d3151 | ||
|
|
bc6666f31a |
BIN
data/1.prot
BIN
data/1.prot
Binary file not shown.
@@ -6,7 +6,7 @@ metadata:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
name: cart-actor-x86
|
name: cart-actor-x86
|
||||||
spec:
|
spec:
|
||||||
replicas: 0
|
replicas: 3
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: cart-actor
|
app: cart-actor
|
||||||
@@ -92,7 +92,7 @@ metadata:
|
|||||||
arch: arm64
|
arch: arm64
|
||||||
name: cart-actor-arm64
|
name: cart-actor-arm64
|
||||||
spec:
|
spec:
|
||||||
replicas: 3
|
replicas: 0
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: cart-actor
|
app: cart-actor
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ func (p *GrainLocalPool) GetGrains() map[CartId]*CartGrain {
|
|||||||
|
|
||||||
func (p *GrainLocalPool) GetGrain(id CartId) (*CartGrain, error) {
|
func (p *GrainLocalPool) GetGrain(id CartId) (*CartGrain, error) {
|
||||||
var err error
|
var err error
|
||||||
p.mu.RLock()
|
// p.mu.RLock()
|
||||||
defer p.mu.RUnlock()
|
// defer p.mu.RUnlock()
|
||||||
grain, ok := p.grains[id]
|
grain, ok := p.grains[id]
|
||||||
grainLookups.Inc()
|
grainLookups.Inc()
|
||||||
if grain == nil || !ok {
|
if grain == nil || !ok {
|
||||||
|
|||||||
@@ -320,8 +320,8 @@ func (p *SyncedPool) Negotiate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *SyncedPool) GetHealthyRemotes() []*RemoteHost {
|
func (p *SyncedPool) GetHealthyRemotes() []*RemoteHost {
|
||||||
p.mu.RLock()
|
// p.mu.RLock()
|
||||||
defer p.mu.RUnlock()
|
// defer p.mu.RUnlock()
|
||||||
remotes := make([]*RemoteHost, 0, len(p.remotes))
|
remotes := make([]*RemoteHost, 0, len(p.remotes))
|
||||||
for _, r := range p.remotes {
|
for _, r := range p.remotes {
|
||||||
if r.IsHealthy() {
|
if r.IsHealthy() {
|
||||||
@@ -422,12 +422,14 @@ func (p *SyncedPool) AddRemote(host string) error {
|
|||||||
|
|
||||||
func (p *SyncedPool) getGrain(id CartId) (Grain, error) {
|
func (p *SyncedPool) getGrain(id CartId) (Grain, error) {
|
||||||
var err error
|
var err error
|
||||||
|
p.mu.RLock()
|
||||||
|
defer p.mu.RUnlock()
|
||||||
localGrain, ok := p.local.grains[id]
|
localGrain, ok := p.local.grains[id]
|
||||||
if !ok {
|
if !ok {
|
||||||
// check if remote grain exists
|
// check if remote grain exists
|
||||||
p.mu.RLock()
|
|
||||||
remoteGrain, ok := p.remoteIndex[id]
|
remoteGrain, ok := p.remoteIndex[id]
|
||||||
p.mu.RUnlock()
|
|
||||||
if ok {
|
if ok {
|
||||||
remoteLookupCount.Inc()
|
remoteLookupCount.Inc()
|
||||||
return remoteGrain, nil
|
return remoteGrain, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user