Documentation
¶
Overview ¶
Package keyspace provides utilities for keyspace for nextgen TiDB.
Keyspace are used to isolate data and operations, allowing for multi-tenancy in next generation TiDB. Each keyspace represents a logical cluster on top of the underlying physical cluster.
There are two types of keyspace: user keyspace and reserved internal keyspace, currently, only SYSTEM keyspace is reserved for internal use.
SYSTEM keyspace is reserved for system-level services and data, currently, only the DXF service uses this keyspace. As user keyspace depends on SYSTEM keyspace, we need to make sure SYSTEM keyspace exist before user keyspace start serving any user traffic. So for the deployment of nextgen cluster, we need to:
- Deploy PD/TiKV and other components, wait them to be ready to serve TiDB access.
- Deploy SYSTEM keyspace, wait it fully bootstrapped.
- Deploy other user keyspace, they can be deployed concurrently.
During upgrade, we also need to follow above order, i.e. We need to upgrade the SYSTEM keyspace first, then user keyspace.
Note: serverless also use keyspace, and have the special NULL and DEFAULT keyspace, while nextgen hasn't.
Index ¶
- Constants
- Variables
- func GetKeyspaceNameBySettings() (keyspaceName string)
- func GetKeyspaceNameBytesBySettings() []byte
- func IsKeyspaceNameEmpty(keyspaceName string) bool
- func MakeKeyspaceEtcdNamespace(c tikv.Codec) string
- func MakeKeyspaceEtcdNamespaceSlash(c tikv.Codec) string
- func WrapZapcoreWithKeyspace() zap.Option
Constants ¶
const ( // System is the keyspace name for SYSTEM keyspace. // see doc.go for more detail. System = "SYSTEM" )
Variables ¶
var CodecV1 = tikv.NewCodecV1(tikv.ModeTxn)
CodecV1 represents api v1 codec.
Functions ¶
func GetKeyspaceNameBySettings ¶
func GetKeyspaceNameBySettings() (keyspaceName string)
GetKeyspaceNameBySettings is used to get Keyspace name setting.
func GetKeyspaceNameBytesBySettings ¶
func GetKeyspaceNameBytesBySettings() []byte
GetKeyspaceNameBytesBySettings is used to get keyspace name setting as a byte slice.
func IsKeyspaceNameEmpty ¶
IsKeyspaceNameEmpty is used to determine whether keyspaceName is set.
func MakeKeyspaceEtcdNamespace ¶
MakeKeyspaceEtcdNamespace return the keyspace prefix path for etcd namespace
func MakeKeyspaceEtcdNamespaceSlash ¶
MakeKeyspaceEtcdNamespaceSlash return the keyspace prefix path for etcd namespace, and end with a slash.
func WrapZapcoreWithKeyspace ¶
WrapZapcoreWithKeyspace is used to wrap zapcore.Core.
Types ¶
This section is empty.