-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
516 lines (493 loc) · 18.4 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
[package]
name = "tikv"
version = "8.3.0-alpha"
authors = ["The TiKV Authors"]
description = "A distributed transactional key-value database powered by Rust and Raft"
license = "Apache-2.0"
keywords = ["KV", "distributed-systems", "raft"]
homepage = "https://tikv.org"
repository = "https://github.com/tikv/tikv/"
readme = "README.md"
edition = "2021"
publish = false
[features]
default = ["test-engine-kv-rocksdb", "test-engine-raft-raft-engine"]
trace-tablet-lifetime = ["engine_rocks/trace-lifetime"]
tcmalloc = ["tikv_alloc/tcmalloc"]
jemalloc = ["tikv_alloc/jemalloc", "engine_rocks/jemalloc"]
mimalloc = ["tikv_alloc/mimalloc"]
snmalloc = ["tikv_alloc/snmalloc"]
portable = ["engine_rocks/portable"]
sse = ["engine_rocks/sse"]
mem-profiling = ["tikv_alloc/mem-profiling"]
failpoints = [
"fail/failpoints",
"raftstore/failpoints",
"tikv_util/failpoints",
"engine_rocks/failpoints",
"raft_log_engine/failpoints",
]
testexport = [
"raftstore/testexport",
"api_version/testexport",
"causal_ts/testexport",
"engine_traits/testexport",
"engine_rocks/testexport",
"engine_panic/testexport",
"hybrid_engine/testexport",
]
test-engine-kv-rocksdb = ["engine_test/test-engine-kv-rocksdb"]
test-engine-raft-raft-engine = ["engine_test/test-engine-raft-raft-engine"]
test-engines-rocksdb = ["engine_test/test-engines-rocksdb"]
test-engines-panic = ["engine_test/test-engines-panic"]
pprof-fp = ["pprof/frame-pointer"]
openssl-vendored = [
"openssl/vendored",
"hyper-tls/vendored",
# NB: the "openssl" feature does not make grpcio-sys v0.10 depends on
# openssl-sys, and it can not find the static openssl built by openssl-sys.
# Enabling "grpcio/openssl-vendored" explicitly makes grpcio-sys depends on
# openssl-sys and correctly links to the static openssl.
"grpcio/openssl-vendored",
# NB: Enable SM4 support if OpenSSL is built from source and statically linked.
"encryption_export/sm4",
]
# for testing configure propegate to other crates
# https://stackoverflow.com/questions/41700543/can-we-share-test-utilites-between-crates
testing = []
[lib]
name = "tikv"
[dependencies]
anyhow = "1.0"
api_version = { workspace = true }
async-stream = "0.2"
async-trait = "0.1"
backtrace = "0.3"
batch-system = { workspace = true }
byteorder = "1.2"
causal_ts = { workspace = true }
chrono = { workspace = true }
codec = { workspace = true }
collections = { workspace = true }
concurrency_manager = { workspace = true }
coprocessor_plugin_api = { workspace = true }
crc32fast = "1.2"
crc64fast = "0.1"
crossbeam = { workspace = true }
crypto = { workspace = true }
dashmap = "5"
encryption_export = { workspace = true }
engine_panic = { workspace = true }
engine_rocks = { workspace = true }
engine_traits = { workspace = true }
error_code = { workspace = true }
fail = "0.5"
file_system = { workspace = true }
flate2 = { version = "1.0", default-features = false, features = ["zlib"] }
futures = { version = "0.3", features = ["thread-pool", "compat"] }
futures-executor = "0.3.1"
futures-timer = "3.0"
futures-util = { version = "0.3.1", default-features = false, features = [
"io",
"async-await",
] }
fxhash = "0.2.1"
getset = "0.1"
grpcio = { workspace = true }
grpcio-health = { workspace = true }
health_controller = { workspace = true }
hex = "0.4"
http = "0"
hybrid_engine = { workspace = true }
hyper = { version = "0.14", features = ["full"] }
hyper-tls = "0.5"
into_other = { workspace = true }
itertools = "0.10"
keyed_priority_queue = "0.4"
keys = { workspace = true }
kvproto = { workspace = true }
lazy_static = "1.3"
libc = "0.2"
libloading = "0.7"
log = { version = "0.4", features = [
"max_level_trace",
"release_max_level_debug",
] }
log_wrappers = { workspace = true }
match-template = "0.0.1"
memory_trace_macros = { workspace = true }
mime = "0.3.13"
more-asserts = "0.2"
mur3 = "0.1"
nom = { version = "5.1.0", default-features = false, features = ["std"] }
notify = "4"
num-traits = "0.2.14"
num_cpus = "1"
online_config = { workspace = true }
openssl = { workspace = true }
parking_lot = "0.12"
paste = "1.0"
pd_client = { workspace = true }
pin-project = "1.0"
pnet_datalink = "0.23"
pprof = { version = "0.13", default-features = false, features = [
"flamegraph",
"protobuf-codec",
] }
prometheus = { version = "0.13", features = ["nightly"] }
prometheus-static-metric = "0.5"
protobuf = { version = "2.8", features = ["bytes"] }
raft = { workspace = true }
raft_log_engine = { workspace = true }
raftstore = { workspace = true, features = ["engine_rocks"] }
raftstore-v2 = { workspace = true }
rand = "0.7.3"
range_cache_memory_engine = { workspace = true }
regex = "1.3"
resource_control = { workspace = true }
resource_metering = { workspace = true }
rev_lines = "0.2.1"
seahash = "4.1.0"
security = { workspace = true }
semver = "0.11"
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
serde_ignored = "0.1"
serde_json = { version = "1.0", features = ["preserve_order"] }
service = { workspace = true }
slog = { workspace = true }
slog-global = { workspace = true }
smallvec = "1.4"
sst_importer = { workspace = true }
strum = { version = "0.20", features = ["derive"] }
sync_wrapper = "0.1.1"
sysinfo = "0.26"
tempfile = "3.0"
thiserror = "1.0"
tidb_query_aggr = { workspace = true }
tidb_query_common = { workspace = true }
tidb_query_datatype = { workspace = true }
tidb_query_executors = { workspace = true }
tidb_query_expr = { workspace = true }
tikv_alloc = { workspace = true }
tikv_kv = { workspace = true }
tikv_util = { workspace = true }
time = { workspace = true }
tipb = { workspace = true }
tokio = { version = "1.17", features = ["full"] }
tokio-openssl = "0.6"
tokio-timer = { workspace = true }
toml = "0.5"
tracing-active-tree = { workspace = true }
tracker = { workspace = true }
txn_types = { workspace = true }
url = "2"
uuid = { version = "0.8.1", features = ["serde", "v4"] }
walkdir = "2"
yatp = { workspace = true }
[dev-dependencies]
api_version = { workspace = true, features = ["testexport"] }
engine_test = { workspace = true }
engine_traits_tests = { workspace = true }
example_coprocessor_plugin = { workspace = true } # should be a binary dependency
hyper-openssl = "0.9"
panic_hook = { workspace = true }
raftstore = { workspace = true, features = ["testexport"] }
reqwest = { version = "0.11", features = ["blocking"] }
test_sst_importer = { workspace = true }
test_util = { workspace = true }
tokio = { version = "1.17", features = ["macros", "rt-multi-thread", "time"] }
zipf = "6.1.0"
[patch.crates-io]
# TODO: remove this when new raft-rs is published.
raft = { git = "https://github.com/tikv/raft-rs", branch = "master" }
raft-proto = { git = "https://github.com/tikv/raft-rs", branch = "master" }
protobuf = { git = "https://github.com/pingcap/rust-protobuf", branch = "v2.8" }
protobuf-codegen = { git = "https://github.com/pingcap/rust-protobuf", branch = "v2.8" }
# TODO: remove this replacement after rusoto_s3 truly supports virtual-host style (https://github.com/rusoto/rusoto/pull/1823).
# UPDATE: use openssl for signature to support fips 140
rusoto_core = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
rusoto_credential = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
rusoto_kms = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
rusoto_mock = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
rusoto_s3 = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
rusoto_sts = { git = "https://github.com/tikv/rusoto", branch = "gh1482-s3-addr-styles" }
# NOTICE: use openssl for signature to support fips 140
tame-oauth = { git = "https://github.com/tikv/tame-oauth", branch = "fips-0.9" }
snappy-sys = { git = "https://github.com/tikv/rust-snappy.git", branch = "static-link" }
# remove this when https://github.com/danburkert/fs2-rs/pull/42 is merged.
fs2 = { git = "https://github.com/tikv/fs2-rs", branch = "tikv" }
# Remove this when a new version is release. We need to solve rust-lang/cmake-rs#143.
cmake = { git = "https://github.com/rust-lang/cmake-rs" }
sysinfo = { git = "https://github.com/tikv/sysinfo", branch = "0.26-fix-cpu" }
[target.'cfg(target_os = "linux")'.dependencies]
procinfo = { git = "https://github.com/tikv/procinfo-rs", rev = "7693954bd1dd86eb1709572fd7b62fd5f7ff2ea1" }
# When you modify TiKV cooperatively with kvproto, this will be useful to submit the PR to TiKV and the PR to
# kvproto at the same time.
# After the PR to kvproto is merged, remember to comment this out and run `cargo update -p kvproto`.
# [patch.'https://github.com/pingcap/kvproto']
# kvproto = { git = "https://github.com/your_github_id/kvproto", branch = "your_branch" }
#
# After the PR to rust-rocksdb is merged, remember to comment this out and run `cargo update -p rocksdb`.
# [patch.'https://github.com/tikv/rust-rocksdb']
# rocksdb = { git = "https://github.com/your_github_id/rust-rocksdb", branch = "your_branch" }
[workspace]
# See https://github.com/rust-lang/rfcs/blob/master/text/2957-cargo-features2.md
# Without resolver = 2, using `cargo build --features x` to build `cmd`
# will _not_ propagate the feature `x` into `cmd`'s direct dependencies.
resolver = "2"
members = [
"cmd/tikv-ctl",
"cmd/tikv-server",
"components/api_version",
"components/backup",
"components/backup-stream",
"components/batch-system",
"components/causal_ts",
"components/cdc",
"components/cloud",
"components/cloud/aws",
"components/cloud/azure",
"components/cloud/gcp",
"components/codec",
"components/collections",
"components/concurrency_manager",
"components/coprocessor_plugin_api",
"components/crossbeam-skiplist",
"components/crypto",
"components/encryption",
"components/encryption/export",
"components/engine_rocks_helper",
# Only enable tirocks in local development, otherwise it can slow down compilation.
# TODO: always enable tirocks and remove engine_rocks.
# "components/engine_tirocks",
"components/error_code",
"components/external_storage",
"components/file_system",
"components/health_controller",
"components/into_other",
"components/keys",
"components/log_wrappers",
"components/online_config",
"components/panic_hook",
"components/pd_client",
"components/profiler",
"components/raftstore",
"components/raftstore-v2",
"components/resolved_ts",
"components/resource_control",
"components/resource_metering",
"components/security",
"components/server",
"components/service",
"components/snap_recovery",
"components/sst_importer",
"components/test_backup",
"components/test_coprocessor",
"components/test_coprocessor_plugin/example_plugin",
"components/test_pd",
"components/test_pd_client",
"components/test_raftstore",
"components/test_raftstore-v2",
"components/test_raftstore_macro",
"components/test_sst_importer",
"components/test_storage",
"components/test_util",
"components/tidb_query_aggr",
"components/tidb_query_codegen",
"components/tidb_query_common",
"components/tidb_query_datatype",
"components/tidb_query_executors",
"components/tidb_query_expr",
"components/tikv_alloc",
"components/tikv_kv",
"components/tikv_util",
"components/tipb_helper",
"components/tracker",
"components/txn_types",
"fuzz",
"fuzz/fuzzer-afl",
"fuzz/fuzzer-honggfuzz",
"fuzz/fuzzer-libfuzzer",
"tests",
]
default-members = ["cmd/tikv-server", "cmd/tikv-ctl"]
[workspace.dependencies]
api_version = { path = "components/api_version" }
aws = { path = "components/cloud/aws" }
azure = { path = "components/cloud/azure" }
backup = { path = "components/backup", default-features = false }
backup-stream = { path = "components/backup-stream", default-features = false }
batch-system = { path = "components/batch-system" }
causal_ts = { path = "components/causal_ts" }
cdc = { path = "components/cdc", default-features = false }
# Do not enable default-features because it implicitly enables oldtime which is
# vulnerable to RUSTSEC-2020-0071, see more in deny.toml.
chrono = { version = "0.4", default-features = false }
# Do not enable default-features because it implicitly enables the unsound
# "atty" crate, see more about RUSTSEC-2021-0145 in deny.toml.
clap = { version = "2.32", default-features = false, features = [
"suggestions",
"vec_map",
] }
cloud = { path = "components/cloud" }
codec = { path = "components/codec" }
collections = { path = "components/collections" }
concurrency_manager = { path = "components/concurrency_manager" }
coprocessor_plugin_api = { path = "components/coprocessor_plugin_api" }
crossbeam-skiplist = { path = "components/crossbeam-skiplist" }
encryption = { path = "components/encryption" }
encryption_export = { path = "components/encryption/export" }
engine_panic = { path = "components/engine_panic" }
engine_rocks = { path = "components/engine_rocks" }
hybrid_engine = { path = "components/hybrid_engine" }
range_cache_memory_engine = { path = "components/range_cache_memory_engine" }
engine_rocks_helper = { path = "components/engine_rocks_helper" }
engine_test = { path = "components/engine_test", default-features = false }
engine_traits = { path = "components/engine_traits" }
engine_traits_tests = { path = "components/engine_traits_tests", default-features = false }
error_code = { path = "components/error_code" }
external_storage = { path = "components/external_storage" }
file_system = { path = "components/file_system" }
crypto = { path = "components/crypto" }
gcp = { path = "components/cloud/gcp" }
health_controller = { path = "components/health_controller" }
into_other = { path = "components/into_other" }
keys = { path = "components/keys" }
log_wrappers = { path = "components/log_wrappers" }
memory_trace_macros = { path = "components/memory_trace_macros" }
online_config = { path = "components/online_config" }
panic_hook = { path = "components/panic_hook" }
pd_client = { path = "components/pd_client" }
profiler = { path = "components/profiler" }
raft_log_engine = { path = "components/raft_log_engine" }
raftstore = { path = "components/raftstore", default-features = false }
raftstore-v2 = { path = "components/raftstore-v2", default-features = false }
resolved_ts = { path = "components/resolved_ts" }
resource_control = { path = "components/resource_control" }
resource_metering = { path = "components/resource_metering" }
security = { path = "components/security" }
server = { path = "components/server" }
service = { path = "components/service" }
snap_recovery = { path = "components/snap_recovery", default-features = false }
sst_importer = { path = "components/sst_importer", default-features = false }
test_backup = { path = "components/test_backup", default-features = false }
test_coprocessor = { path = "components/test_coprocessor", default-features = false }
example_coprocessor_plugin = { path = "components/test_coprocessor_plugin/example_plugin" }
test_pd = { path = "components/test_pd" }
test_pd_client = { path = "components/test_pd_client" }
test_raftstore = { path = "components/test_raftstore", default-features = false }
test_raftstore-v2 = { path = "components/test_raftstore-v2", default-features = false }
test_raftstore_macro = { path = "components/test_raftstore_macro" }
test_sst_importer = { path = "components/test_sst_importer" }
test_storage = { path = "components/test_storage", default-features = false }
test_util = { path = "components/test_util" }
tidb_query_aggr = { path = "components/tidb_query_aggr" }
tidb_query_codegen = { path = "components/tidb_query_codegen" }
tidb_query_common = { path = "components/tidb_query_common" }
tidb_query_datatype = { path = "components/tidb_query_datatype" }
tidb_query_executors = { path = "components/tidb_query_executors" }
tidb_query_expr = { path = "components/tidb_query_expr" }
tikv = { path = ".", default-features = false }
tikv_alloc = { path = "components/tikv_alloc" }
tikv_kv = { path = "components/tikv_kv", default-features = false }
tikv_util = { path = "components/tikv_util" }
tipb_helper = { path = "components/tipb_helper" }
time = { version = "0.1" }
tracker = { path = "components/tracker" }
txn_types = { path = "components/txn_types" }
# External libs
raft = { version = "0.7.0", default-features = false, features = [
"protobuf-codec",
] }
raft-engine = { git = "https://github.com/tikv/raft-engine.git", features = [
"swap",
] }
raft-engine-ctl = { git = "https://github.com/tikv/raft-engine.git" }
grpcio = { version = "0.10.4", default-features = false, features = [
"openssl",
"protobuf-codec",
"nightly",
] }
grpcio-health = { version = "0.10.4", default-features = false, features = [
"protobuf-codec",
] }
tipb = { git = "https://github.com/pingcap/tipb.git" }
kvproto = { git = "https://github.com/pingcap/kvproto.git" }
yatp = { git = "https://github.com/tikv/yatp.git", branch = "master" }
tokio-timer = { git = "https://github.com/tikv/tokio", branch = "tokio-timer-hotfix" }
tokio-executor = { git = "https://github.com/tikv/tokio", branch = "tokio-timer-hotfix" }
slog = { version = "2.3", features = [
"max_level_trace",
"release_max_level_debug",
] }
slog-global = { version = "0.1", git = "https://github.com/tikv/slog-global.git", rev = "d592f88e4dbba5eb439998463054f1a44fbf17b9" }
tracing-active-tree = { git = "https://github.com/tikv/tracing-active-tree.git", features = [
"coarsetime",
], rev = "a71f8f8148f88ab759deb6d3e1d62d07ab218347" }
# This `tracing` is only used for `tracing-active-tree`, enable its attributes only.
tracing = { version = "0.1.39", default-features = false, features = [
"attributes",
"std",
] }
openssl = "0.10"
openssl-sys = "0.9"
heck = "0.3"
crossbeam = "0.8"
crossbeam-channel = "0.5"
crossbeam-utils = "0.8"
crossbeam-epoch = "0.9"
[profile.dev.package.grpcio-sys]
debug = false
opt-level = 1
[profile.dev.package.librocksdb_sys]
debug = false
opt-level = 1
[profile.dev.package.libtitan_sys]
debug = false
opt-level = 1
[profile.dev.package.tests]
debug = 1
opt-level = 1
[profile.dev]
opt-level = 0
debug = 0
codegen-units = 4
lto = false
incremental = true
panic = 'unwind'
debug-assertions = true
overflow-checks = false
rpath = false
[profile.release]
opt-level = 3
debug = false
codegen-units = 1
lto = "thin"
incremental = false
panic = 'unwind'
debug-assertions = false
overflow-checks = false
rpath = false
[profile.release.package.server]
opt-level = 1
codegen-units = 4
[profile.test]
opt-level = 0
debug = 0
codegen-units = 16
lto = false
incremental = true
debug-assertions = true
overflow-checks = true
rpath = false
# The benchmark profile is identical to release, except that lto = false
[profile.bench]
opt-level = 3
debug = false
codegen-units = 1
lto = 'thin'
incremental = false
debug-assertions = false
overflow-checks = false
rpath = false