Skip to content

Commit

Permalink
fix the conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed May 27, 2022
1 parent 449f2e4 commit d05b07d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,10 @@ func (c *RaftCluster) RemoveStore(storeID uint64, physicallyDestroyed bool) erro
return err
}

// buryStore marks a store as tombstone in cluster.
// BuryStore marks a store as tombstone in cluster.
// The store should be empty before calling this func
// State transition: Offline -> Tombstone.
func (c *RaftCluster) buryStore(storeID uint64) error {
func (c *RaftCluster) BuryStore(storeID uint64) error {
c.Lock()
defer c.Unlock()

Expand Down Expand Up @@ -1184,7 +1184,7 @@ func (c *RaftCluster) checkStores() {
// If the store is empty, it can be buried.
regionCount := c.core.GetStoreRegionCount(offlineStore.GetId())
if regionCount == 0 {
if err := c.buryStore(offlineStore.GetId()); err != nil {
if err := c.BuryStore(offlineStore.GetId()); err != nil {
log.Error("bury store failed",
zap.Stringer("store", offlineStore),
errs.ZapError(err))
Expand Down
6 changes: 3 additions & 3 deletions server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ func (s *testClusterInfoSuite) TestSetOfflineStore(c *C) {
for storeID := uint64(0); storeID <= 4; storeID++ {
store := cluster.GetStore(storeID)
if store == nil || store.IsUp() {
c.Assert(cluster.buryStore(storeID), NotNil)
c.Assert(cluster.BuryStore(storeID), NotNil)
} else {
c.Assert(cluster.buryStore(storeID), IsNil)
c.Assert(cluster.BuryStore(storeID), IsNil)
}
}
}
Expand All @@ -270,7 +270,7 @@ func (s *testClusterInfoSuite) TestReuseAddress(c *C) {
c.Assert(cluster.RemoveStore(3, true), IsNil)
// store 4: tombstone
c.Assert(cluster.RemoveStore(4, true), IsNil)
c.Assert(cluster.buryStore(4), IsNil)
c.Assert(cluster.BuryStore(4), IsNil)

for id := uint64(1); id <= 4; id++ {
storeInfo := cluster.GetStore(id)
Expand Down
2 changes: 1 addition & 1 deletion tests/server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ func (s *clusterTestSuite) TestTransferLeaderBack(c *C) {
c.Assert(err, IsNil)
c.Assert(rc1, NotNil)
// tombstone a store, and remove its record
c.Assert(rc1.BuryStore(1, false), IsNil)
c.Assert(rc1.BuryStore(1), IsNil)
c.Assert(rc1.RemoveTombStoneRecords(), IsNil)

// transfer PD leader back to the previous PD
Expand Down

0 comments on commit d05b07d

Please sign in to comment.