-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
local-sst-writer: test only logical content and test many keys (#57203)
ref #57105
- Loading branch information
Showing
12 changed files
with
286 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4580,13 +4580,13 @@ def go_deps(): | |
name = "com_github_lance6716_pebble", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/lance6716/pebble", | ||
sha256 = "fad807913eaf5ff14651929475dda5e5c6f6838dbaeef11b7eddefe771f01f1e", | ||
strip_prefix = "github.com/lance6716/[email protected]20241104073946-6f55c09bd183", | ||
sha256 = "8fe7ce7009c4d2b0ae28f4c3d62f38b6256ee20e47944490b58cb1d33a155725", | ||
strip_prefix = "github.com/lance6716/[email protected]20241108073934-da961314c63f", | ||
urls = [ | ||
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241104073946-6f55c09bd183.zip", | ||
"http://ats.apps.svc/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241104073946-6f55c09bd183.zip", | ||
"https://cache.hawkingrei.com/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241104073946-6f55c09bd183.zip", | ||
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241104073946-6f55c09bd183.zip", | ||
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip", | ||
"http://ats.apps.svc/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip", | ||
"https://cache.hawkingrei.com/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip", | ||
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip", | ||
], | ||
) | ||
go_repository( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[replication] | ||
enable-placement-rules = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# config of tikv | ||
[storage] | ||
reserve-space = "1KB" | ||
data-dir = "/tmp/lightning_test/tikv1/" | ||
|
||
[coprocessor] | ||
region-max-keys = 100 | ||
region-split-keys = 60 | ||
|
||
[rocksdb] | ||
max-open-files = 4096 | ||
[raftdb] | ||
max-open-files = 4096 | ||
|
||
[raftstore] | ||
# true (default value) for high reliability, this can prevent data loss when power failure. | ||
sync-log = false | ||
capacity = "10GB" | ||
# Speed up TiKV region heartbeat | ||
pd-heartbeat-tick-interval = "1s" | ||
|
||
[cdc] | ||
hibernate-regions-compatible=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2019 PingCAP, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# currently the script is WIP and not used in the CI. | ||
|
||
set -eu | ||
CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
export UTILS_DIR="$CUR/../../tests/_utils" | ||
export PATH="$PATH:$CUR/../../bin:$UTILS_DIR" | ||
export TEST_DIR=/tmp/lightning_test | ||
export COV_DIR="/tmp/group_cover" | ||
mkdir -p $COV_DIR || true | ||
export TIKV_CONFIG="$CUR/config/tikv-no-tls.toml" | ||
export PD_CONFIG="$CUR/config/pd-no-tls.toml" | ||
export TESTS_ROOT="$CUR" | ||
source $UTILS_DIR/run_services | ||
|
||
export TIKV_COUNT=1 | ||
export PD_HTTP_PROTO="http" | ||
|
||
# Create COV_DIR if not exists | ||
if [ -d "$COV_DIR" ]; then | ||
mkdir -p $COV_DIR | ||
fi | ||
|
||
# Reset TEST_DIR | ||
rm -rf $TEST_DIR && mkdir -p $TEST_DIR | ||
|
||
trap stop_services EXIT | ||
start_services $@ --no-tiflash --no-tidb | ||
|
||
rm /tmp/*.sst || true | ||
|
||
# change to project root | ||
cd $CUR/../.. | ||
go test ./pkg/lightning/tikv -tikv-write-test -test.v -test.run TestIntegrationTest | ||
cp /tmp/lightning_test/tikv1/import/*_write_*.sst /tmp/tikv-write-cf.sst | ||
|
||
for prefix in go tikv; do | ||
bin/tikv-ctl sst_dump --file=/tmp/$prefix-write-cf.sst --command=scan --output_hex --show_properties \ | ||
> /tmp/$prefix-write-cf-scan.txt | ||
awk " | ||
/from \[\] to \[\]/ { f1 = 1; next } | ||
/Table Properties:/ { f1 = 0; f2 = 1; next } | ||
f1 { print > \"/tmp/$prefix-write-cf-data.txt\" } | ||
f2 { print > \"/tmp/$prefix-write-cf-properties.txt\" } | ||
" /tmp/$prefix-write-cf-scan.txt | ||
# filter some properties that are not deterministic by logical content | ||
grep -v -F -e "data block size" -e "index block size" -e "entries for filter" -e "(estimated) table size" \ | ||
-e "DB identity" -e "DB session identity" -e "DB host id" -e "original file number" -e "unique ID" \ | ||
/tmp/$prefix-write-cf-properties.txt > /tmp/$prefix-write-cf-properties.txt.filtered | ||
done | ||
|
||
diff /tmp/tikv-write-cf-data.txt /tmp/go-write-cf-data.txt | ||
diff /tmp/tikv-write-cf-properties.txt.filtered /tmp/go-write-cf-properties.txt.filtered | ||
|
||
# clean tikv-ctl temporary files | ||
rm -rf ctl-engine-info-log || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.