Get desktop application:
View/edit binary Protocol Buffers messages
ImportSST provides a service to import a generated SST file to a region in TiKV. In order to import an SST file to a region, the user should: 1. Retrieve the meta of the region according to the SST file's range. 2. Upload the SST file to the servers where the region's peers locate in. 3. Issue an ingest request to the region's leader with the SST file's metadata. It's the user's responsibility to make sure that the SST file is uploaded to the servers where the region's peers locate in, before issue the ingest request to the region's leader. However, the region can be scheduled (so the location of the region's peers will be changed) or split/merged (so the range of the region will be changed), after the SST file is uploaded, but before the SST file is ingested. So, the region's epoch is provided in the SST file's metadata, to guarantee that the region's epoch must be the same between the SST file is uploaded and ingested later.
Switch to normal/import mode.
(message has no fields)
Get import mode(normal/import).
(message has no fields)
Upload an SST file to a server.
(message has no fields)
Ingest an uploaded SST file to a region.
Compact the specific range for better performance.
(message has no fields)
The download speed limit (bytes/second). Set to 0 for unlimited speed.
(message has no fields)
Download an SST file from an external storage, and performs key-rewrite after downloading.
Map represents the map of <name, SSTMeta>. We'll generate all SSTMeta into one SST File.
resolved_ts is used to merge related SST Files.
The SST meta used to identify the downloaded file. Must be the same among all nodes in the same Raft group. Note: the "crc32" and "cf_name" fields are ignored in this request, and the "range" field represents the closed key range after rewrite (as origin keys in encoded representation).
The file name of the SST file.
Performs a key prefix rewrite after downloading the SST file. All keys in the SST will be rewritten as: new_key = new_key_prefix + old_key[len(old_key_prefix)..] When used for TiDB, rewriting the prefix changes the table ID. Please note that key-rewrite is applied on the origin keys in encoded representation (the SST itself should still use data keys in encoded representation). You need to ensure that the keys before and after rewriting are in the same order, otherwise the RPC request will fail.
The identity for the stroage backend. When this field presents, the storage would be cached. If there is a cached storage, TiKV would use it driectly.
cipher_info is used to decrypt sst when download sst
The type of the download request.
The actual key range (after rewrite) of the downloaded SST. The range is inclusive in both ends.
Whether the SST is empty. An empty SST is prohibited in TiKV, do not ingest if this field is true. (Deprecated, should be replaced by checking `length == 0` in the future)
The CRC32 checksum of the rewritten SST file (implementation can return zero, indicating the CRC32 was not calculated).
The actual length of the rewritten SST file.
This field only return when file-copy backup enabled. Because it will merge many SST files in a download request.
Open a write stream to generate sst files
Ingest Multiple files in one request
Collect duplicate data from TiKV.
Return only the keys found by scanning, not their values.
We only check the data whose timestamp is larger than `min_commit_ts`. `min_commit_ts` is exclueded.
The these keys will be in asc order (but commit time is in desc order), and the content is just like following: [ {key: "key1", value: "value11", commit_ts: 1005}, {key: "key1", value: "value12", commit_ts: 1004}, {key: "key1", value: "value13", commit_ts: 1001}, {key: "key2", value: "value21", commit_ts: 1004}, {key: "key2", value: "value22", commit_ts: 1002}, ... ]
Apply download & apply increment kv files to TiKV.
The meta of the KV file.
Performs a key prefix rewrite after downloading the file. All keys in the files will be rewritten as: new_key = new_key_prefix + old_key[len(old_key_prefix)..] When used for TiDB, rewriting the prefix changes the table ID. Please note that key-rewrite is applied on the origin keys in encoded representation. You need to ensure that the keys before and after rewriting are in the same order, otherwise the RPC request will fail.
The identity for the stroage backend. When this field presents, the storage would be cached. If there is a cached storage, TiKV would use it driectly.
context represents region info and it used to build raft commands.
plaintext data key to decrypt kv file if configured during log backup.
master keys config used to decrypt data keys in restore if configured during log backup.
The actual key range (after rewrite) of the downloaded file. The range is inclusive in both ends.
ClearFiles clear applied file after restore succeed.
clear files in import directory with given prefix.
Suspend ingest for data listeners don't support catching import data.
whether to suspend new imports.
the duration of import service suspension when should_deny_imports is false, this won't take effect.
The identifier for the caller.
The last state before this RPC.
Used as request type in: ImportSST.Compact
Used as field type in:
Compact files in the range and above the output level. Compact all files if the range is not specified. Compact all files to the bottommost level if the output level is -1.
Used in:
For the compatibility with old version of TiDBs
For the TiDBs with newer versions that support keyspace feature.
For now it is just used for distinguishing the error of the request with the error of gRPC, add more concrete types if it is necessary later.
Used in:
, , , , ,We meet some internal errors of the store.
Used as response type in: ImportSST.Ingest, ImportSST.MultiIngest
Used in:
The file name of the KV file.
file offset, sometimes only need to get a part of data from the merged file
file length for check.
range length of the merged file, if it exists.
tell us which cf should apply. WRITE_CF or DEFAULT_CF e.g.
is_delete represents whether we should delete the kv in tikv. it may not be too much delete file. only rollBack operation will generate delete kv file.
the key ts space being smaller than start_ts can be filter.
the key ts space large than restore_ts can be filter.
used for checksum when download kv file.
the key ts space less than start_snapshot_ts can be filter. Deprecated: this field 'start_snapshot_ts' is replaced by the field 'start_ts'.
the compression type for the file.
encryption information of the kv file, not set if encryption is not enabled.
Used in:
Used in:
,Used in:
Used in:
, , , ,Used in:
To be compatible with the key encoding of API V2. This field should be generated from the client instead of the server, since the message will be send to all the replicas of a region. Otherwise, the underlying data generated by the server would be inconsistent which is hard to scale for other features like MVCC over RawKV.
A rewrite rule is applied on the *encoded* keys (the internal storage representation).
Used in:
,(Optional) Rewrite all keys in the range to use this timestamp.
(Optional) Skip keys with timestamps greater than this during download, useful for compacted SST backups.
(Optional) Skip write CF keys with timestamps less than this during download. Default CF keys are preserved.
Used in:
, , , , , , , , ,total_kvs and total_bytes is equivalent to PD's approximate_keys and approximate_size set these values can save time from tikv upload keys and size to PD through Heartbeat.
API version implies the encode of the key and value.
cipher_iv is used to encrypt/decrypt sst
Used in:
,Used as request type in: ImportSST.SwitchMode
Used as field type in:
Used in: