Skip to content

Commit

Permalink
Merge branch 'master' into fix/datarace-when-concurrent-save-the-same…
Browse files Browse the repository at this point in the history
…-file
  • Loading branch information
lonng authored Oct 15, 2020
2 parents 6959440 + 99501f8 commit 4e67051
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 33 deletions.
12 changes: 5 additions & 7 deletions components/err/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {

type errorSpec struct {
Code string `toml:"code" json:"code"`
Message string `toml:"message" json:"message"`
Error string `toml:"error" json:"error"`
Description string `toml:"description" json:"description"`
Tags []string `toml:"tags" json:"tags"`
Workaround string `toml:"workaround" json:"workaround"`
Expand All @@ -81,7 +81,7 @@ func (f errorSpec) String() string {
## Description
%s
## Workaround
%s`, header, f.Message, f.Description, f.Workaround))
%s`, header, f.Error, f.Description, f.Workaround))
}

func searchError(args []string) error {
Expand Down Expand Up @@ -112,9 +112,7 @@ func loadIndex() (bleve.Index, map[string]*errorSpec, error) {
return nil, nil, errors.New("component `doc` doesn't running in TiUP mode")
}

type tomlFile struct {
Errors map[string]*errorSpec `toml:"error"`
}
type tomlFile map[string]*errorSpec
indexPath := filepath.Join(dir, "index")

index, err := bleve.Open(indexPath)
Expand Down Expand Up @@ -156,7 +154,7 @@ func loadIndex() (bleve.Index, map[string]*errorSpec, error) {
if _, err := toml.DecodeReader(reader, &file); err != nil {
return nil
}
for code, spec := range file.Errors {
for code, spec := range file {
spec.Code = code
errStore[code] = spec
if !needIndex {
Expand All @@ -177,7 +175,7 @@ func buildIndexMapping() mapping.IndexMapping {

documentMapping := bleve.NewDocumentMapping()

documentMapping.AddFieldMappingsAt("message", englishTextFieldMapping)
documentMapping.AddFieldMappingsAt("error", englishTextFieldMapping)
documentMapping.AddFieldMappingsAt("description", englishTextFieldMapping)
documentMapping.AddFieldMappingsAt("workaround", englishTextFieldMapping)
documentMapping.AddFieldMappingsAt("tags", englishTextFieldMapping)
Expand Down
6 changes: 3 additions & 3 deletions components/err/testdata/tidb.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[error.8005]
message = '''Write Conflict, txnStartTS is stale'''
[8005]
error = '''Write Conflict, txnStartTS is stale'''
tags = ["tikv", "tidb-txn"]
description = '''In versions before 3.0.8, TiDB implements the optimistic transaction mode by default, in which the transaction commit might fail because of transaction conflict. To make sure that the commit succeeds, you need to modify the application andad an automatic retry mechanism. You can avoid this issue by using the pessimistic transaction mode of TiDB.'''
workaround = '''To apply the pessimistic transaction mode, choose any of the following three methods that suits your needs:
Expand All @@ -17,4 +17,4 @@ After you set `global.tidb_txn_mode` to `pessimistic`, the pessimistic transacti
- Execute the `set @@global.tidb_txn_mode = 'optimistic;'` or `set @@global.tidb_txn_mode = '';` to allow all newly created sessions of the entire cluster to apply the optimistic transaction mode to the transactions.
The `BEGIN PESSIMISTIC;` and `BEGIN OPTIMISTIC;` statements take precedence over the `tidb_txn_mode` system variable. Transactions started with these two statements ignore the system variable and support using both the pessimistic and optimistic transaction modes.
To disable the pessimistic transaction mode, modify the configuration file and add `enable = false` to the `[pessimistic-txn]` category.'''
To disable the pessimistic transaction mode, modify the configuration file and add `enable = false` to the `[pessimistic-txn]` category.'''
70 changes: 47 additions & 23 deletions doc/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

For detailed documentation, see the manual which starts with an [overview](overview.md).

To get started with TiDB using TiUP, see the [TiDB quick start guide](https://docs.pingcap.com/tidb/stable/quick-start-with-tidb). To deploy TiDB using TiUP in a production-like environment, see the [TiDB deploymeny guide](https://docs.pingcap.com/tidb/stable/production-deployment-using-tiup).

## Installation

```sh
Expand Down Expand Up @@ -40,8 +42,7 @@ tiup update --all
After installing `tiup`, you can use it to install binaries of TiDB components and create clusters.

```
Use "tiup [command] --help" for more information about a command.Use "tiup [command] --help" for more information about a command.
s a command-line component management tool that can help to download and install
TiUP is a command-line component management tool that can help to download and install
TiDB platform components to the local system. You can run a specific version of a component via
"tiup <component>[:version]". If no version number is specified, the latest version installed
locally will be used. If the specified component does not have any version installed locally,
Expand All @@ -58,36 +59,23 @@ Available Commands:
update Update tiup components to the latest version
status List the status of instantiated components
clean Clean the data of instantiated components
mirror Manage a repository mirror for TiUP components
telemetry Controls things about telemetry
completion Output shell completion code for the specified shell (bash or zsh)
env Show the list of system environment variable that related to TiUP
help Help about any command or component
Available Components:
tidb TiDB is an open source distributed HTAP database compatible with the MySQL protocol
tikv Distributed transactional key-value database, originally created to complement TiDB
pd PD is the abbreviation for Placement Driver. It is used to manage and schedule the TiKV cluster
playground Bootstrap a local TiDB cluster
client A simple mysql client to connect TiDB
prometheus The Prometheus monitoring system and time series database.
tpc A toolbox to benchmark workloads in TPC
package A toolbox to package tiup component
tiops Bootstrap a remote TiDB cluster
grafana Grafana is the open source analytics & monitoring solution for every database
alertmanager Prometheus Alertmanager
blackbox_exporter Blackbox prober exporter
node_exporter Blackbox prober exporter
pushgateway Blackbox prober exporter
tiflash
drainer The drainer componet of TiDB binlog service
pump The pump componet of TiDB binlog service
cluster Deploy a TiDB cluster for production
Components Manifest:
use "tiup list" to fetch the latest components manifest
Flags:
-B, --binary <component>[:version] Print binary path of a specific version of a component <component>[:version]
and the latest version installed will be selected if no version specified
--binpath string Specify the binary path of component instance
-h, --help help for tiup
--help Help for this command
--skip-version-check Skip the strict version check, by default a version must be a valid SemVer string
-T, --tag string Specify a tag for component instance
--version version for tiup
-v, --version Print the version of tiup
Component instances with the same "tag" will share a data directory ($TIUP_HOME/data/$tag):
$ tiup --tag mycluster playground
Expand All @@ -106,3 +94,39 @@ Examples:
Use "tiup [command] --help" for more information about a command.
```

The components available are

```
Name Owner Description
---- ----- -----------
alertmanager pingcap Prometheus alertmanager
bench pingcap Benchmark database with different workloads
blackbox_exporter pingcap Blackbox prober exporter
br pingcap TiDB/TiKV cluster backup restore tool
cdc pingcap CDC is a change data capture tool for TiDB
client pingcap A simple mysql client to connect TiDB
cluster pingcap Deploy a TiDB cluster for production
ctl pingcap TiDB controller suite
dm pingcap Data Migration Platform manager
dm-master pingcap dm-master component of Data Migration Platform
dm-worker pingcap dm-worker component of Data Migration Platform
dmctl pingcap dmctl component of Data Migration Platform
drainer pingcap The drainer componet of TiDB binlog service
dumpling pingcap Dumpling is a CLI tool that helps you dump MySQL/TiDB data
grafana pingcap Grafana is the open source analytics & monitoring solution for every database
insight pingcap TiDB-Insight collector
node_exporter pingcap Exporter for machine metrics
package pingcap A toolbox to package tiup component
pd pingcap PD is the abbreviation for Placement Driver. It is used to manage and schedule the TiKV cluster
pd-recover pingcap PD Recover is a disaster recovery tool of PD, used to recover the PD cluster which cannot start or provide services normally
playground pingcap Bootstrap a local TiDB cluster
prometheus pingcap The Prometheus monitoring system and time series database
pump pingcap The pump componet of TiDB binlog service
pushgateway pingcap Push acceptor for ephemeral and batch jobs
tidb pingcap TiDB is an open source distributed HTAP database compatible with the MySQL protocol
tidb-lightning pingcap TiDB Lightning is a tool used for fast full import of large amounts of data into a TiDB cluster
tiflash pingcap The TiFlash Columnar Storage Engine
tikv pingcap Distributed transactional key-value database, originally created to complement TiDB
tiup pingcap TiUP is a command-line component management tool that can help to download and install TiDB platform components to the local system
```

0 comments on commit 4e67051

Please sign in to comment.