Skip to content

Commit

Permalink
Rpc replication ack level update (uber#3266)
Browse files Browse the repository at this point in the history
  • Loading branch information
yux0 authored May 19, 2020
1 parent af7583c commit 3aab131
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ func (e *historyEngineImpl) Start() {

clusterMetadata := e.shard.GetClusterMetadata()
if e.replicatorProcessor != nil &&
clusterMetadata.GetReplicationConsumerConfig().Type != sconfig.ReplicationConsumerTypeRPC &&
e.config.EnableKafkaReplication() {
(clusterMetadata.GetReplicationConsumerConfig().Type != sconfig.ReplicationConsumerTypeRPC ||
e.config.EnableKafkaReplication()) {
e.replicatorProcessor.Start()
}

Expand Down
9 changes: 9 additions & 0 deletions service/history/replicatorQueueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,15 @@ func (p *replicatorQueueProcessorImpl) readTasks(readLevel int64) ([]task.Info,
func (p *replicatorQueueProcessorImpl) updateAckLevel(ackLevel int64) error {
err := p.shard.UpdateReplicatorAckLevel(ackLevel)

// TODO: Remove this after enabled the rpc replication
clusterMetadata := p.shard.GetClusterMetadata()
for name, cluster := range clusterMetadata.GetAllClusterInfo() {
if !cluster.Enabled || clusterMetadata.GetCurrentClusterName() == name{
continue
}
p.shard.UpdateClusterReplicationLevel(name, ackLevel)
}

// this is a hack, since there is not dedicated ticker on the queue processor
// to periodically send out sync shard message, put it here
now := clock.NewRealTimeSource().Now()
Expand Down

0 comments on commit 3aab131

Please sign in to comment.