Skip to content

Commit 3fa61fc

Browse files
lance6716YuJuncendisksing
authored
update import_sstpb and fix go & rust docker image build (#1224)
Signed-off-by: lance6716 <[email protected]> Signed-off-by: hillium <[email protected]> Co-authored-by: hillium <[email protected]> Co-authored-by: disksing <[email protected]>
1 parent d552d2f commit 3fa61fc

File tree

7 files changed

+531
-378
lines changed

7 files changed

+531
-378
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN apt-get update --yes \
3939
&& apt-get install --yes curl unzip \
4040
&& rm -rf /var/lib/apt/lists/*
4141

42-
ENV GO_VERSION "1.18.2"
42+
ENV GO_VERSION "1.21.7"
4343
RUN rm -rf /usr/local/go \
4444
&& curl -O https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz \
4545
&& tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz \

pkg/brpb/brpb.pb.go

+310-238
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/import_sstpb/import_sstpb.pb.go

+174-136
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/brpb.proto

+13-1
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,12 @@ enum FileType {
644644
Put = 1;
645645
}
646646

647+
enum FileFormat {
648+
Unknown = 0;
649+
KvStream = 1;
650+
Sst = 2;
651+
}
652+
647653
// DataFileGroup is the merged file info in log-backup
648654
message DataFileGroup {
649655
// Path of the file.
@@ -669,6 +675,7 @@ message DataFileInfo {
669675
bytes sha256 = 1;
670676
// Path of the file.
671677
string path = 2;
678+
// The number of KV entries recoreded in the file.
672679
int64 number_of_entries = 3;
673680

674681
/// Below are extra information of the file, for better filtering files.
@@ -694,7 +701,7 @@ message DataFileInfo {
694701
// The table ID of the file contains, when `is_meta` is true, would be ignored.
695702
int64 table_id = 13;
696703

697-
// The file length.
704+
// The length of concateing all kv entries in this file.
698705
uint64 length = 14;
699706

700707
// The minimal begin ts in default cf if this file is write cf.
@@ -704,11 +711,16 @@ message DataFileInfo {
704711
uint64 range_offset = 16;
705712

706713
// The range length of the merged file, if it exists.
714+
// Diff as `length`, it presents the 'used space' of the file.
707715
uint64 range_length = 17;
708716

709717
// The compression type for the file.
710718
CompressionType compression_type = 18;
711719

720+
// The format of the file's content.
721+
FileFormat file_format = 19;
722+
723+
712724
// It may support encrypting at future.
713725
reserved "iv";
714726
}

proto/import_sstpb.proto

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ message SSTMeta {
128128
kvrpcpb.APIVersion api_version = 11;
129129
// cipher_iv is used to encrypt/decrypt sst
130130
bytes cipher_iv = 12;
131+
// in order to be compatible with features like PiTR, import service should use
132+
// this optional fields to compose data in write CF. When it's not set, import
133+
// service can use WriteBatch.commit_ts instead.
134+
uint64 start_ts = 13;
131135
}
132136

133137
// A rewrite rule is applied on the *encoded* keys (the internal storage

scripts/check.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ check-protos-compatible() {
2020
export PATH=$GOPATH/bin:$PATH
2121

2222
if [ ! -f "$GOPATH/bin/protolock" ]; then
23-
GO111MODULE=off go get github.com/nilslice/protolock/cmd/protolock
24-
GO111MODULE=off go install github.com/nilslice/protolock/cmd/protolock
23+
GO111MODULE=off go install github.com/nilslice/protolock/cmd/[email protected]
2524
fi
2625

2726
if protolock status -lockdir=scripts -protoroot=proto; then
@@ -31,6 +30,8 @@ check-protos-compatible() {
3130
# In order not to block local branch development, when meet break compatibility will force to update `proto.lock`.
3231
protolock commit --force -lockdir=scripts -protoroot=proto
3332
fi
33+
# git report error like "fatal: detected dubious ownership in repository at" when reading the host's git folder
34+
git config --global --add safe.directory $(pwd)
3435
# If the output message is encountered, please add proto.lock to git as well.
3536
git diff scripts/proto.lock | cat
3637
git diff --quiet scripts/proto.lock

scripts/proto.lock

+26
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,22 @@
244244
"integer": 1
245245
}
246246
]
247+
},
248+
{
249+
"name": "FileFormat",
250+
"enum_fields": [
251+
{
252+
"name": "Unknown"
253+
},
254+
{
255+
"name": "KvStream",
256+
"integer": 1
257+
},
258+
{
259+
"name": "Sst",
260+
"integer": 2
261+
}
262+
]
247263
}
248264
],
249265
"messages": [
@@ -1607,6 +1623,11 @@
16071623
"id": 18,
16081624
"name": "compression_type",
16091625
"type": "CompressionType"
1626+
},
1627+
{
1628+
"id": 19,
1629+
"name": "file_format",
1630+
"type": "FileFormat"
16101631
}
16111632
],
16121633
"reserved_names": [
@@ -6723,6 +6744,11 @@
67236744
"id": 12,
67246745
"name": "cipher_iv",
67256746
"type": "bytes"
6747+
},
6748+
{
6749+
"id": 13,
6750+
"name": "start_ts",
6751+
"type": "uint64"
67266752
}
67276753
]
67286754
},

0 commit comments

Comments
 (0)