apache / apache/fluss

ReplicaStateMachine should consider ReplicaDeletionStarted/ReplicaDeletionSuccessful as a valid previous state

Open
#764 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.1k
Forks
625
Avg merge
3d 14h
Merged PRs (30d)
97

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/alibaba/fluss/issues) and found nothing similar.

### Fluss version

0.6.0 (latest release)

### Please describe the bug 🐞

`com.alibaba.fluss.server.coordinator.TableManagerITCase#testPartitionedTableManagement` has many ERROR logs that reporting

```
5015 [coordinator-event-thread] ERROR com.alibaba.fluss.server.coordinator.statemachine.ReplicaStateMachine [] - Replica state for TableBucketReplica{tableBucket=TableBucket{tableId=0, partitionId=0, bucket=1}, replica=1, tablePath=db1.tb1_YEAR, partition=2025} should be in the [NewReplica, OnlineReplica, OfflineReplica] before moving to state OfflineReplica, but the current state is ReplicaDeletionStarted.
5016 [coordinator-event-thread] ERROR com.alibaba.fluss.server.coordinator.statemachine.ReplicaStateMachine [] - Fail to change state for table bucket replica TableBucketReplica{tableBucket=TableBucket{tableId=0, partitionId=0, bucket=1}, replica=1, tablePath=db1.tb1_YEAR, partition=2025} from ReplicaDeletionStarted to OfflineReplica.
5017 [coordinator-event-thread] ERROR com.alibaba.fluss.server.coordinator.statemachine.ReplicaStateMachine [] - Replica state for TableBucketReplica{tableBucket=TableBucket{tableId=0, partitionId=0, bucket=2}, replica=2, tablePath=db1.tb1_YEAR, partition=2025} should be in the [NewReplica, OnlineReplica, OfflineReplica] before moving to state OfflineReplica, but the current state is ReplicaDeletionStarted.

```

### Solution

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with com.alibaba.fluss.server.coordinator.statemachine.ReplicaStateMachine and the failing test com.alibaba.fluss.server.coordinator.TableManagerITCase#testPartitionedTableManagement. Trace the transition to OfflineReplica when the current state is ReplicaDeletionStarted or ReplicaDeletionSuccessful. Done means the test no longer emits these invalid-state errors and passes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.