Skip to content

Commit

Permalink
metanode: Show metapartition id correctly
Browse files Browse the repository at this point in the history
When loading an mp, initialize `MetaPartitionConfig.PartitionID`
correctly. Otherwise, if something goes wrong in `mp.onStart`,
we can only get "id=0".

Signed-off-by: Sheng Yong <[email protected]>
  • Loading branch information
shyodx authored and leonrayang committed Sep 7, 2022
1 parent b67b79a commit 05cfb0b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions metanode/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,11 @@ func (m *metadataManager) loadPartitions() (err error) {
}

partitionConfig := &MetaPartitionConfig{
NodeId: m.nodeId,
RaftStore: m.raftStore,
RootDir: path.Join(m.rootDir, fileName),
ConnPool: m.connPool,
PartitionId: id,
NodeId: m.nodeId,
RaftStore: m.raftStore,
RootDir: path.Join(m.rootDir, fileName),
ConnPool: m.connPool,
}
partitionConfig.AfterStop = func() {
m.detachPartition(id)
Expand Down

0 comments on commit 05cfb0b

Please sign in to comment.