Skip to content

Commit

Permalink
server/http: fix scatter table API and add document (pingcap#8424)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch authored Nov 23, 2018
1 parent 84d1299 commit 1e0876f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/tidb_http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@
*Hint: For the index column which column type is timezone dependent, e.g. `timestamp`, convert its value to UTC
timezone.*

1. Scatter regions of the specified table, add a `scatter-range` scheduler for the PD and the range is same as the table range.

```shell
curl -X POST http://{TiDBIP}:10080/tables/{db}/{table}/scatter
```

**Note**: The `scatter-range` scheduler may conflict with the global scheduler, do not use it for long periods on the larger table.

1. Stop scatter the regions, disable the `scatter-range` scheduler for the specified table.

```shell
curl -X POST http://{TiDBIP}:10080/tables/{db}/{table}/stop-scatter
```

1. Get TiDB server settings

```shell
Expand Down
4 changes: 2 additions & 2 deletions server/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ func (h tableHandler) addScatterSchedule(startKey, endKey []byte, name string) e
}
input := map[string]string{
"name": "scatter-range",
"start_key": url.QueryEscape(string(startKey)),
"end_key": url.QueryEscape(string(endKey)),
"start_key": string(startKey),
"end_key": string(endKey),
"range_name": name,
}
v, err := json.Marshal(input)
Expand Down

0 comments on commit 1e0876f

Please sign in to comment.