Skip to content

Commit 9d32e6d

Browse files
authored
Add S3 settings to BlobDepot configuration (#14942)
1 parent 8d7d1c8 commit 9d32e6d

File tree

32 files changed

+103
-84
lines changed

32 files changed

+103
-84
lines changed

ydb/core/backup/common/backup_restore_traits.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "backup_restore_traits.h"
22

3-
#include <ydb/core/protos/flat_scheme_op.pb.h>
43
#include <ydb/library/yverify_stream/yverify_stream.h>
54

65
#include <util/generic/hash.h>

ydb/core/backup/s3/export_s3_uploader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "extstorage_usage_config.h"
88

99
#include <ydb/core/base/appdata.h>
10-
#include <ydb/core/protos/flat_scheme_op.pb.h>
1110
#include <ydb/library/services/services.pb.h>
1211
#include <ydb/core/wrappers/s3_storage_config.h>
1312
#include <ydb/core/wrappers/s3_wrapper.h>

ydb/core/backup/s3/extstorage_usage_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "backup_restore_traits.h"
66

77
#include <ydb/core/base/events.h>
8-
#include <ydb/core/protos/flat_scheme_op.pb.h>
98
#include <ydb/public/api/protos/ydb_export.pb.h>
109

1110
#include <contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/include/aws/s3/model/StorageClass.h>

ydb/core/external_sources/object_storage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <ydb/core/external_sources/object_storage/inference/infer_config.h>
1010
#include <ydb/core/kqp/gateway/actors/kqp_ic_gateway_actors.h>
1111
#include <ydb/core/protos/external_sources.pb.h>
12-
#include <ydb/core/protos/flat_scheme_op.pb.h>
1312
#include <ydb/library/yql/providers/common/http_gateway/yql_http_gateway.h>
1413
#include <yql/essentials/providers/common/provider/yql_provider_names.h>
1514
#include <yql/essentials/providers/common/structured_token/yql_token_builder.h>

ydb/core/formats/arrow/serializer/native.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <ydb/core/base/appdata_fwd.h>
77
#include <ydb/core/protos/config.pb.h>
8-
#include <ydb/core/protos/flat_scheme_op.pb.h>
98

109
#include <ydb/library/accessor/accessor.h>
1110
#include <ydb/library/conclusion/result.h>

ydb/core/protos/blob_depot_config.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "ydb/core/protos/hive.proto";
2+
import "ydb/core/protos/s3_settings.proto";
23

34
package NKikimrBlobDepot;
45

@@ -17,6 +18,28 @@ message TChannelProfile {
1718
optional TChannelKind.E ChannelKind = 4;
1819
}
1920

21+
message TS3BackendSettings {
22+
optional NKikimrSchemeOp.TS3Settings Settings = 1; // how to connect to S3 (mandatory field)
23+
24+
// data (when written) is first stored in ordinary data channel and then asynchronously transferred to S3 storage by
25+
// BlobDepot tablet; amount of stored data can be controlled by following settings
26+
//
27+
// future operation may include modes when data is uploaded by agents directly to the storage
28+
29+
// when do we fully stop processing new queries until some data is uploaded
30+
optional uint64 MaxPendingBytes = 2;
31+
32+
// when do we start throttling (if set, this must be strictly less than MaxPendingBytes, which also must be set)
33+
optional uint64 ThrottleStartBytes = 3;
34+
35+
// upload rate (bytes per second) at ThrottleStartBytes amount of data (which linearly drops to 0 as amount increases
36+
// up to MaxPendingBytes)
37+
optional uint64 ThrottleMaxBytesPerSecond = 4;
38+
39+
// number of concurrent puts
40+
optional uint32 AsyncUploadPutsInFlight = 5 [default = 1];
41+
}
42+
2043
message TBlobDepotConfig {
2144
repeated TChannelProfile ChannelProfiles = 1;
2245
optional uint32 VirtualGroupId = 2;
@@ -25,4 +48,5 @@ message TBlobDepotConfig {
2548
optional bool HiveContacted = 5;
2649
optional NKikimrHive.TEvCreateTablet HiveParams = 6; // extra hive parameters
2750
optional uint64 TenantHiveId = 7;
51+
optional TS3BackendSettings S3BackendSettings = 8; // if set, then this tablet stores all its data in S3 (except for some cache/inflight)
2852
}

ydb/core/protos/flat_scheme_op.proto

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import "ydb/core/protos/follower_group.proto";
88
import "ydb/core/protos/index_builder.proto";
99
import "ydb/core/protos/pqconfig.proto";
1010
import "ydb/core/protos/replication.proto";
11+
import "ydb/core/protos/s3_settings.proto";
1112
import "ydb/core/protos/schemeshard/operations.proto";
1213
import "ydb/core/protos/subdomains.proto";
1314
import "ydb/core/protos/table_stats.proto";
@@ -21,7 +22,6 @@ import "ydb/library/actors/protos/actors.proto";
2122
import "ydb/library/formats/arrow/protos/accessor.proto";
2223
import "ydb/library/mkql_proto/protos/minikql.proto";
2324
import "ydb/public/api/protos/ydb_coordination.proto";
24-
import "ydb/public/api/protos/ydb_export.proto";
2525
import "ydb/public/api/protos/ydb_table.proto";
2626
import "ydb/public/api/protos/ydb_topic.proto";
2727
import "ydb/public/api/protos/ydb_value.proto";
@@ -476,7 +476,7 @@ enum EOlapProgramType {
476476

477477
message TStorageTierConfig {
478478
optional string Name = 1;
479-
optional TS3Settings ObjectStorage = 2;
479+
optional NKikimrSchemeOp.TS3Settings ObjectStorage = 2;
480480
optional TCompressionOptions Compression = 3;
481481
}
482482

@@ -1162,62 +1162,9 @@ message TYTSettings {
11621162
optional bool UseTypeV3 = 8;
11631163
};
11641164

1165-
message TSecretId {
1166-
optional string Id = 1;
1167-
optional string OwnerId = 2;
1168-
}
1169-
1170-
message TSecretValue {
1171-
optional string Data = 1;
1172-
}
1173-
1174-
message TSecretableVariable {
1175-
oneof Data {
1176-
TSecretId SecretId = 1;
1177-
TSecretValue Value = 2;
1178-
}
1179-
}
1180-
1181-
message TS3Settings {
1182-
enum EScheme {
1183-
HTTP = 0;
1184-
HTTPS = 1;
1185-
}
1186-
1187-
optional string Endpoint = 1;
1188-
optional EScheme Scheme = 2 [default = HTTPS];
1189-
optional string Bucket = 3;
1190-
optional string ObjectKeyPattern = 4; // dst for backup, src for restore
1191-
optional string AccessKey = 5;
1192-
optional string SecretKey = 6;
1193-
optional Ydb.Export.ExportToS3Settings.StorageClass StorageClass = 7 [default = STANDARD];
1194-
optional bool VerifySSL = 8;
1195-
optional string ProxyHost = 9;
1196-
optional uint32 ProxyPort = 10;
1197-
optional EScheme ProxyScheme = 11;
1198-
optional string Region = 12;
1199-
optional TSecretableVariable SecretableAccessKey = 13;
1200-
optional TSecretableVariable SecretableSecretKey = 14;
1201-
optional bool UseVirtualAddressing = 15 [default = true];
1202-
1203-
message TLimits {
1204-
optional uint32 ReadBatchSize = 1 [default = 8388608]; // 8 MB
1205-
optional uint32 MinWriteBatchSize = 2 [default = 5242880]; // 5 MB
1206-
reserved 3; // ReadBufferSizeLimit
1207-
};
1208-
1209-
optional TLimits Limits = 100;
1210-
optional uint32 RequestTimeoutMs = 101;
1211-
optional uint32 HttpRequestTimeoutMs = 102;
1212-
optional uint32 ConnectionTimeoutMs = 103;
1213-
1214-
optional uint32 ExecutorThreadsCount = 104 [default = 32];
1215-
optional uint32 MaxConnectionsCount = 105 [default = 32];
1216-
};
1217-
12181165
message TTaskCleaner {
12191166
optional uint64 PathId = 1;
1220-
optional TS3Settings StorageSettings = 2;
1167+
optional NKikimrSchemeOp.TS3Settings StorageSettings = 2;
12211168
optional string TieringId = 3;
12221169
}
12231170

@@ -1233,7 +1180,7 @@ message TBackupTask {
12331180

12341181
oneof Settings {
12351182
TYTSettings YTSettings = 4;
1236-
TS3Settings S3Settings = 9;
1183+
NKikimrSchemeOp.TS3Settings S3Settings = 9;
12371184
}
12381185

12391186
optional TPathDescription Table = 10; // for further restore
@@ -1269,7 +1216,7 @@ message TRestoreTask {
12691216
optional uint32 NumberOfRetries = 5;
12701217

12711218
oneof Settings {
1272-
TS3Settings S3Settings = 6;
1219+
NKikimrSchemeOp.TS3Settings S3Settings = 6;
12731220
}
12741221

12751222
optional bool ValidateChecksums = 7; // currently available for s3

ydb/core/protos/s3_settings.proto

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import "ydb/public/api/protos/ydb_export.proto";
2+
3+
package NKikimrSchemeOp;
4+
option java_package = "ru.yandex.kikimr.proto";
5+
6+
message TSecretId {
7+
optional string Id = 1;
8+
optional string OwnerId = 2;
9+
}
10+
11+
message TSecretValue {
12+
optional string Data = 1;
13+
}
14+
15+
message TSecretableVariable {
16+
oneof Data {
17+
TSecretId SecretId = 1;
18+
TSecretValue Value = 2;
19+
}
20+
}
21+
22+
message TS3Settings {
23+
enum EScheme {
24+
HTTP = 0;
25+
HTTPS = 1;
26+
}
27+
28+
optional string Endpoint = 1;
29+
optional EScheme Scheme = 2 [default = HTTPS];
30+
optional string Bucket = 3;
31+
optional string ObjectKeyPattern = 4; // dst for backup, src for restore
32+
optional string AccessKey = 5;
33+
optional string SecretKey = 6;
34+
optional Ydb.Export.ExportToS3Settings.StorageClass StorageClass = 7 [default = STANDARD];
35+
optional bool VerifySSL = 8;
36+
optional string ProxyHost = 9;
37+
optional uint32 ProxyPort = 10;
38+
optional EScheme ProxyScheme = 11;
39+
optional string Region = 12;
40+
optional TSecretableVariable SecretableAccessKey = 13;
41+
optional TSecretableVariable SecretableSecretKey = 14;
42+
optional bool UseVirtualAddressing = 15 [default = true];
43+
44+
message TLimits {
45+
optional uint32 ReadBatchSize = 1 [default = 8388608]; // 8 MB
46+
optional uint32 MinWriteBatchSize = 2 [default = 5242880]; // 5 MB
47+
reserved 3; // ReadBufferSizeLimit
48+
};
49+
50+
optional TLimits Limits = 100;
51+
optional uint32 RequestTimeoutMs = 101;
52+
optional uint32 HttpRequestTimeoutMs = 102;
53+
optional uint32 ConnectionTimeoutMs = 103;
54+
55+
optional uint32 ExecutorThreadsCount = 104 [default = 32];
56+
optional uint32 MaxConnectionsCount = 105 [default = 32];
57+
}

ydb/core/protos/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ SRCS(
113113
query_stats.proto
114114
replication.proto
115115
resource_broker.proto
116+
s3_settings.proto
116117
scheme_board.proto
117118
scheme_board_mon.proto
118119
scheme_log.proto

ydb/core/tx/columnshard/columnshard_schema.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <ydb/core/tablet_flat/flat_cxx_database.h>
55
#include <ydb/core/tx/long_tx_service/public/types.h>
6-
#include <ydb/core/protos/flat_scheme_op.pb.h>
76
#include <ydb/core/protos/tx_columnshard.pb.h>
87
#include <ydb/core/tx/columnshard/engines/insert_table/insert_table.h>
98
#include <ydb/core/tx/columnshard/engines/column_engine.h>

0 commit comments

Comments
 (0)