 1.2 Go in TiDBGo in TiDB 申砾@PingCAP Agenda • About Me • What is TiDB • TiDB Architecture • SQL Layer Internal • Golang in TiDB • Next Step of TiDB About Me • Shen Li (申砾) • Tech Lead of TiDB, VP of Engineering Why Go? • Productivity • Concurrency • Great for network programming • GC • Standard libraries && Tools • Good performance • Quick improvement Go in TiDB • More than 100k lines of Go code and session is hard • Account for large memory allocation • Account for memory consuming operators New in Go1.8 • Better GC • Pauses 50μs • sort.Slice Next Step of TiDB • Switch to gRPC • Document support0 码力 | 27 页 | 935.47 KB | 6 月前3 1.2 Go in TiDBGo in TiDB 申砾@PingCAP Agenda • About Me • What is TiDB • TiDB Architecture • SQL Layer Internal • Golang in TiDB • Next Step of TiDB About Me • Shen Li (申砾) • Tech Lead of TiDB, VP of Engineering Why Go? • Productivity • Concurrency • Great for network programming • GC • Standard libraries && Tools • Good performance • Quick improvement Go in TiDB • More than 100k lines of Go code and session is hard • Account for large memory allocation • Account for memory consuming operators New in Go1.8 • Better GC • Pauses 50μs • sort.Slice Next Step of TiDB • Switch to gRPC • Document support0 码力 | 27 页 | 935.47 KB | 6 月前3
 1.3 Go practices in TiDB   姚维Go Practices in TiDB 姚维 PingCAP wink@pingcap.com Agenda ● How to build a stable database ○ Schrodinger-test platform ○ Failpoint injection ○ Goroutine-leak detection ● Optimization ○ Chunk vs interface{} errors.New("mock commit error") // } …. } https://github.com/pingcap/tidb/blob/master/store/tikv/txn.go#L223 The generated gofail code func (txn *tikvTxn) Commit(ctx context.Context) error { if vmockCommitError or: __fp_mockCommitError.BadType(vmockCommitError, "bool"); }; …. } $ gofail enable store/tikv/txn.go Why we need a new failpoint ● Generated code is not readable ● Concurrent testing will use the same0 码力 | 32 页 | 1.76 MB | 6 月前3 1.3 Go practices in TiDB   姚维Go Practices in TiDB 姚维 PingCAP wink@pingcap.com Agenda ● How to build a stable database ○ Schrodinger-test platform ○ Failpoint injection ○ Goroutine-leak detection ● Optimization ○ Chunk vs interface{} errors.New("mock commit error") // } …. } https://github.com/pingcap/tidb/blob/master/store/tikv/txn.go#L223 The generated gofail code func (txn *tikvTxn) Commit(ctx context.Context) error { if vmockCommitError or: __fp_mockCommitError.BadType(vmockCommitError, "bool"); }; …. } $ gofail enable store/tikv/txn.go Why we need a new failpoint ● Generated code is not readable ● Concurrent testing will use the same0 码力 | 32 页 | 1.76 MB | 6 月前3
 2.1.4 PingCAP Go runtime related problems in TiDB production environmentGo runtime related problems in TiDB production environment About me ● Arthur Mao(毛康力), Senior Engineer@PingCAP ● TiDB core developer (top3 contributor) ● GitBook about golang internals (@tiancaiamao) consider priority ● CPU dense workload could affect IO latency Conclusion Part II - Memory control ● Go Runtime ○ Allocated from OS (mmaped) ○ Managed Memory ■ Should the memory be returned to the OS? ○ memory footprint is abnormal ● The memory available on this node is not too much Description ● The Go Runtime thinks it does not use much memory ● The OS does not release the memory (RSS is high) Investigate0 码力 | 56 页 | 50.15 MB | 6 月前3 2.1.4 PingCAP Go runtime related problems in TiDB production environmentGo runtime related problems in TiDB production environment About me ● Arthur Mao(毛康力), Senior Engineer@PingCAP ● TiDB core developer (top3 contributor) ● GitBook about golang internals (@tiancaiamao) consider priority ● CPU dense workload could affect IO latency Conclusion Part II - Memory control ● Go Runtime ○ Allocated from OS (mmaped) ○ Managed Memory ■ Should the memory be returned to the OS? ○ memory footprint is abnormal ● The memory available on this node is not too much Description ● The Go Runtime thinks it does not use much memory ● The OS does not release the memory (RSS is high) Investigate0 码力 | 56 页 | 50.15 MB | 6 月前3
 TiDB v6.1 Documentationof replicas. This can guarantee strong consis- tency, and availability when a minority of replicas go down. To meet the requirements of different disaster tolerance levels, you can configure the geographic use sharding middleware or a distributed SQL database (like TiDB), and the latter is more cost-effective. TiDB adopts a separate computing and storage architecture, which enables you to scale out or scale versions, after modifying a configuration item, you must restart the cluster to make the modification effective. This might interrupt online services. To address this issue, TiDB v6.1.0 introduces the dynamic0 码力 | 4487 页 | 84.44 MB | 1 年前3 TiDB v6.1 Documentationof replicas. This can guarantee strong consis- tency, and availability when a minority of replicas go down. To meet the requirements of different disaster tolerance levels, you can configure the geographic use sharding middleware or a distributed SQL database (like TiDB), and the latter is more cost-effective. TiDB adopts a separate computing and storage architecture, which enables you to scale out or scale versions, after modifying a configuration item, you must restart the cluster to make the modification effective. This might interrupt online services. To address this issue, TiDB v6.1.0 introduces the dynamic0 码力 | 4487 页 | 84.44 MB | 1 年前3
 TiDB v7.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 119 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6020 页 | 106.82 MB | 1 年前3 TiDB v7.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 119 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6020 页 | 106.82 MB | 1 年前3
 TiDB v7.6 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 132 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6123 页 | 107.24 MB | 1 年前3 TiDB v7.6 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 132 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6123 页 | 107.24 MB | 1 年前3
 TiDB v7.1 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 139 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 5716 页 | 104.74 MB | 1 年前3 TiDB v7.1 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 139 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 5716 页 | 104.74 MB | 1 年前3
 TiDB v8.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 153 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6730 页 | 111.36 MB | 10 月前3 TiDB v8.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 153 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6730 页 | 111.36 MB | 10 月前3
 TiDB v8.4 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 148 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6705 页 | 110.86 MB | 10 月前3 TiDB v8.4 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 148 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · majority of replicas. This guarantees strong consistency and availabil- ity when a minority of replicas go down. You can configure the geographic location and number of replicas as needed to meet different databases cannot meet the data capacity requirements of rapidly growing applications. TiDB is a cost-effective solution that adopts a separate comput- ing and storage architecture, enabling easy scaling of computing0 码力 | 6705 页 | 110.86 MB | 10 月前3
 TiDB v6.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 138 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · of replicas. This can guarantee strong consis- tency, and availability when a minority of replicas go down. To meet the requirements of different disaster tolerance levels, you can configure the geographic use sharding middleware or a distributed SQL database (like TiDB), and the latter is more cost-effective. TiDB adopts a separate computing and storage architecture, which enables you to scale out or scale0 码力 | 5282 页 | 99.69 MB | 1 年前3 TiDB v6.5 Documentation· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 138 4.3.2 Go · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · of replicas. This can guarantee strong consis- tency, and availability when a minority of replicas go down. To meet the requirements of different disaster tolerance levels, you can configure the geographic use sharding middleware or a distributed SQL database (like TiDB), and the latter is more cost-effective. TiDB adopts a separate computing and storage architecture, which enables you to scale out or scale0 码力 | 5282 页 | 99.69 MB | 1 年前3
共 43 条
- 1
- 2
- 3
- 4
- 5













