apache / apache/incubator-pegasus

potential replica may not be closed when dropped app

Open
#815 1 comment 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
C++
Stars
2.1k
Forks
328
PR merge metrics
No merged PRs in 30d

Description

## Bug Report
删除表的时候 如果该表有部分分片处于PS_POTENTIAL_SECONDARY状态,有概率出现replica-server遗留了potential状态的replica无法关闭

版本为2.0.0

下面是删除app(appid=3)后,通过remote_command查询到的replica信息
```
D2021-09-17 06:40:44.606 (1631832044606185642 4017) replica.rep_long5.04010000000000b5: replica_stub.cpp:1707:on_gc(): start to garbage collection, replica_count = 4
D2021-09-17 06:40:44.606 (1631832044606199774 4017) replica.rep_long5.04010000000000b5: replica_stub.cpp:1746:on_gc(): gc_shared: gc condition for 3.97@xxxxxxxxx:54801, status = replication::partition_status::PS_POTENTIAL_SECONDARY, garbage_max_decree = 37803, last_durable_decree= 37804, plog_max_commit_on_disk = 37803
D2021-09-17 06:40:44.606 (1631832044606206186 4017) replica.rep_long5.04010000000000b5: replica_stub.cpp:1746:on_gc(): gc_shared: gc condition for 3.13@xxxxxxxxx:54801, status = replication::partition_status::PS_POTENTIAL_SECONDARY, garbage_max_decree = 37894, last_durable_decree= 37895, plog_max_commit_on_disk = 37894
D2021-09-17 06:40:44.606 (1631832044606229313 4017) replica.rep_long5.04010000000000b5: replica_stub.cpp:1746:on_gc(): gc_shared: gc condition for 3.49@xxxxxxxxx:54801, status = replication::partition_status::PS_POTENTIAL_SECONDARY, garbage_max_decree = 37838, last_durable_decree= 37839, plog_max_commit_on_disk = 37838
D2021-09-17 06:40:44.606 (1631832044606232808 4017) replica.rep_long5.04010000000000b5: replica_stub.cpp:1746:on_gc(): gc_shared: gc condition for 3.61@xxxxxxxxx:54801, status = replication::partition_status::PS_POTENTIAL_SECONDARY, garbage_max_decree = 37882, last_durable_decree= 37883, plog_max_commit_on_disk = 37882
```

Contributor guide

Open the contributing guide

Research direction

Start with replica_stub.cpp around on_gc() at lines 1707 and 1746, and inspect the PS_POTENTIAL_SECONDARY cleanup path after dropping app 3. Use the remote_command replica output as the failure case, then verify that dropping an app no longer leaves a potential-state replica that cannot be closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.