Skip to content

Commit

Permalink
bugfix: shard consistency is not using local qurom (cadence-workflow#616
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wxing1292 authored Mar 16, 2018
1 parent 6ad47ff commit 738d103
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions common/persistence/cassandraPersistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,9 @@ var (

type (
cassandraPersistence struct {
session *gocql.Session
lowConslevel gocql.Consistency
shardID int
logger bark.Logger
session *gocql.Session
shardID int
logger bark.Logger
}
)

Expand All @@ -624,13 +623,13 @@ func NewCassandraShardPersistence(hosts string, port int, user, password, dc str
return nil, err
}

return &cassandraPersistence{shardID: -1, session: session, lowConslevel: gocql.One, logger: logger}, nil
return &cassandraPersistence{shardID: -1, session: session, logger: logger}, nil
}

// NewCassandraWorkflowExecutionPersistence is used to create an instance of workflowExecutionManager implementation
func NewCassandraWorkflowExecutionPersistence(shardID int, session *gocql.Session,
logger bark.Logger) (ExecutionManager, error) {
return &cassandraPersistence{shardID: shardID, session: session, lowConslevel: gocql.One, logger: logger}, nil
return &cassandraPersistence{shardID: shardID, session: session, logger: logger}, nil
}

// NewCassandraTaskPersistence is used to create an instance of TaskManager implementation
Expand All @@ -647,7 +646,7 @@ func NewCassandraTaskPersistence(hosts string, port int, user, password, dc stri
if err != nil {
return nil, err
}
return &cassandraPersistence{shardID: -1, session: session, lowConslevel: gocql.One, logger: logger}, nil
return &cassandraPersistence{shardID: -1, session: session, logger: logger}, nil
}

// Close releases the underlying resources held by this object
Expand Down Expand Up @@ -710,7 +709,7 @@ func (d *cassandraPersistence) GetShard(request *GetShardRequest) (*GetShardResp
rowTypeShardWorkflowID,
rowTypeShardRunID,
defaultVisibilityTimestamp,
rowTypeShardTaskID).Consistency(d.lowConslevel)
rowTypeShardTaskID)

result := make(map[string]interface{})
if err := query.MapScan(result); err != nil {
Expand Down

0 comments on commit 738d103

Please sign in to comment.