diff --git a/internal/metarepos/raft_metadata_repository.go b/internal/metarepos/raft_metadata_repository.go index a6867b62f..a229371a5 100644 --- a/internal/metarepos/raft_metadata_repository.go +++ b/internal/metarepos/raft_metadata_repository.go @@ -135,6 +135,7 @@ func NewRaftMetadataRepository(options *MetadataRepositoryOptions) *RaftMetadata sw: stopwaiter.New(), tmStub: tmStub, topicEndPos: make(map[types.TopicID]int), + requestNum: uint64(time.Now().UnixNano()), } mr.storage = NewMetadataStorage(mr.sendAck, options.SnapCount, mr.logger.Named("storage")) diff --git a/internal/metarepos/storage.go b/internal/metarepos/storage.go index 09a5f4e2a..1ca48d972 100644 --- a/internal/metarepos/storage.go +++ b/internal/metarepos/storage.go @@ -431,6 +431,11 @@ func (ms *MetadataStorage) registerLogStream(ls *varlogpb.LogStreamDescriptor) e return verrors.ErrAlreadyExists } + if equal { + // To ensure that it is applied to the meta cache + return nil + } + _, cur := ms.getStateMachine() ms.mtMu.Lock()