Skip to main content
Last updated on

Check All Tablet Segment Lost

Request

GET /api/check_tablet_segment_lost?repair={bool}

Description

There may be some exceptions that cause segment to be lost on BE node. However, the metadata shows that the tablet is normal. This abnormal replica is not detected by FE and cannot be automatically repaired. When query comes, an error about failing to open the data file is thrown, with tablet=<tablet_id> and backend=<be_ip> appended to the message. The function of this interface is to check all tablets on the current BE node that have lost segment.

Version note

Versions before 4.0.8 prefixed such errors with failed to initialize storage reader. Starting from 4.0.8 that prefix is removed and the error message keeps the real underlying cause, so do not use the prefix to identify this situation.

Query parameters

  • repair
    • true: tablets with lost segment will be set to SHUTDOWN status and treated as bad replica, which can be detected and repaired by FE.
    • false: all tablets with missing segment are returned and nothing is done.

Request body

None

Response

The return is all tablets on the current BE node that have lost segment:

```
{
status: "Success",
msg: "Succeed to check all tablet segment",
num: 3,
bad_tablets: [
11190,
11210,
11216
],
set_bad: true,
host: "172.3.0.101"
}
```

Examples

```
curl http://127.0.0.1:8040/api/check_tablet_segment_lost?repair=false
```