Skip to content

Commit 9b78acb

Browse files
committed
Ydb stable 22-4-44
x-stable-origin-commit: 1a8317bc9b27fc6c8a8453c7938b4b252db85a01
1 parent 87f7fce commit 9b78acb

File tree

712 files changed

+3003
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+3003
-1400
lines changed

library/cpp/grpc/server/grpc_request.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ class TGRpcRequestImpl
179179
return Request_;
180180
}
181181

182+
NProtoBuf::Message* GetRequestMut() override {
183+
return Request_;
184+
}
185+
186+
182187
TAuthState& GetAuthState() override {
183188
return AuthState_;
184189
}

library/cpp/grpc/server/grpc_request_base.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class IRequestContextBase: public TThrRefBase {
5353
//! Get pointer to the request's message.
5454
virtual const NProtoBuf::Message* GetRequest() const = 0;
5555

56+
//! Get mutable pointer to the request's message.
57+
virtual NProtoBuf::Message* GetRequestMut() = 0;
58+
5659
//! Get current auth state
5760
virtual TAuthState& GetAuthState() = 0;
5861

ydb/core/client/server/msgbus_server_s3_listing.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,13 @@ class TS3ListingRequestGrpc : protected TMessageConverter, public NMsgBusProxy::
747747
}
748748
GrpcRequest->ReplyWithYdbStatus(grpcStatus);
749749
} else {
750-
Ydb::S3Internal::S3ListingResult grpcResult = TMessageConverter::ConvertResult(msgbusResponse);
751-
GrpcRequest->SendResult(grpcResult, Ydb::StatusIds::SUCCESS);
750+
try {
751+
Ydb::S3Internal::S3ListingResult grpcResult = TMessageConverter::ConvertResult(msgbusResponse);
752+
GrpcRequest->SendResult(grpcResult, Ydb::StatusIds::SUCCESS);
753+
} catch(std::exception ex) {
754+
GrpcRequest->RaiseIssue(NYql::ExceptionToIssue(ex));
755+
GrpcRequest->ReplyWithYdbStatus(Ydb::StatusIds::INTERNAL_ERROR);
756+
}
752757
}
753758
}
754759
};

ydb/core/cms/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ target_link_libraries(ydb-core-cms.global PUBLIC
9393
tools-enum_parser-enum_serialization_runtime
9494
)
9595
target_sources(ydb-core-cms.global PRIVATE
96-
${CMAKE_BINARY_DIR}/ydb/core/cms/bda6b2eb0fe591794e0191b6befe2972.cpp
96+
${CMAKE_BINARY_DIR}/ydb/core/cms/117417182f73c245478c9903130ed8f2.cpp
9797
)
9898
resources(ydb-core-cms.global
99-
${CMAKE_BINARY_DIR}/ydb/core/cms/bda6b2eb0fe591794e0191b6befe2972.cpp
99+
${CMAKE_BINARY_DIR}/ydb/core/cms/117417182f73c245478c9903130ed8f2.cpp
100100
INPUTS
101101
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/index.html
102102
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/cms.css
@@ -124,6 +124,8 @@ resources(ydb-core-cms.global
124124
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/res/remove.png
125125
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/validators.js
126126
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/sentinel_state.js
127+
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/nanotable.js
128+
${CMAKE_SOURCE_DIR}/ydb/core/cms/ui/sentinel.css
127129
KEYS
128130
cms/ui/index.html
129131
cms/ui/cms.css
@@ -151,4 +153,6 @@ resources(ydb-core-cms.global
151153
cms/ui/res/remove.png
152154
cms/ui/validators.js
153155
cms/ui/sentinel_state.js
156+
cms/ui/nanotable.js
157+
cms/ui/sentinel.css
154158
)

ydb/core/cms/cms.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,14 +1052,15 @@ void TCms::Die(const TActorContext& ctx)
10521052
TActorBase::Die(ctx);
10531053
}
10541054

1055-
void TCms::AddHostState(const TNodeInfo &node, TClusterStateResponse &resp, TInstant timestamp)
1055+
void TCms::AddHostState(const TClusterInfoPtr &clusterInfo, const TNodeInfo &node, TClusterStateResponse &resp, TInstant timestamp)
10561056
{
10571057
auto *host = resp.MutableState()->AddHosts();
10581058
host->SetName(node.Host);
10591059
host->SetState(node.State);
10601060
host->SetNodeId(node.NodeId);
10611061
host->SetInterconnectPort(node.IcPort);
10621062
host->SetTimestamp(timestamp.GetValue());
1063+
node.Location.Serialize(host->MutableLocation(), false);
10631064
if (node.State == UP || node.VDisks || node.PDisks) {
10641065
for (const auto flag : GetEnumAllValues<EService>()) {
10651066
if (!(node.Services & flag)) {
@@ -1076,15 +1077,15 @@ void TCms::AddHostState(const TNodeInfo &node, TClusterStateResponse &resp, TIns
10761077
}
10771078

10781079
for (const auto &vdId : node.VDisks) {
1079-
const auto &vdisk = ClusterInfo->VDisk(vdId);
1080+
const auto &vdisk = clusterInfo->VDisk(vdId);
10801081
auto *device = host->AddDevices();
10811082
device->SetName(vdisk.GetDeviceName());
10821083
device->SetState(vdisk.State);
10831084
device->SetTimestamp(timestamp.GetValue());
10841085
}
10851086

10861087
for (const auto &pdId : node.PDisks) {
1087-
const auto &pdisk = ClusterInfo->PDisk(pdId);
1088+
const auto &pdisk = clusterInfo->PDisk(pdId);
10881089
auto *device = host->AddDevices();
10891090
device->SetName(pdisk.GetDeviceName());
10901091
device->SetState(pdisk.State);
@@ -1602,7 +1603,7 @@ void TCms::Handle(TEvCms::TEvClusterStateRequest::TPtr &ev,
16021603
for (const auto &host : rec.GetHosts()) {
16031604
if (ClusterInfo->NodesCount(host) >= 1) {
16041605
for (const TNodeInfo *node : ClusterInfo->HostNodes(host)) {
1605-
AddHostState(*node, resp->Record, ClusterInfo->GetTimestamp());
1606+
AddHostState(ClusterInfo, *node, resp->Record, ClusterInfo->GetTimestamp());
16061607
}
16071608
} else {
16081609
return ReplyWithError<TEvCms::TEvClusterStateResponse>(
@@ -1611,7 +1612,7 @@ void TCms::Handle(TEvCms::TEvClusterStateRequest::TPtr &ev,
16111612
}
16121613
} else {
16131614
for (const auto &entry : ClusterInfo->AllNodes())
1614-
AddHostState(*entry.second, resp->Record, ClusterInfo->GetTimestamp());
1615+
AddHostState(ClusterInfo, *entry.second, resp->Record, ClusterInfo->GetTimestamp());
16151616
}
16161617

16171618
resp->Record.MutableStatus()->SetCode(TStatus::OK);

ydb/core/cms/cms_impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class TCms : public TActor<TCms>, public TTabletExecutedFlat {
7575

7676
void PersistNodeTenants(TTransactionContext& txc, const TActorContext& ctx);
7777

78+
static void AddHostState(const TClusterInfoPtr &clusterInfo, const TNodeInfo &node, NKikimrCms::TClusterStateResponse &resp, TInstant timestamp);
79+
7880
private:
7981
using TActorBase = TActor<TCms>;
8082
using EStatusCode = NKikimrCms::TStatus::ECode;
@@ -355,7 +357,6 @@ class TCms : public TActor<TCms>, public TTabletExecutedFlat {
355357
void Cleanup(const TActorContext &ctx);
356358
void Die(const TActorContext& ctx) override;
357359

358-
void AddHostState(const TNodeInfo &node, NKikimrCms::TClusterStateResponse &resp, TInstant timestamp);
359360
void GetPermission(TEvCms::TEvManagePermissionRequest::TPtr &ev, bool all, const TActorContext &ctx);
360361
void RemovePermission(TEvCms::TEvManagePermissionRequest::TPtr &ev, bool done, const TActorContext &ctx);
361362
void GetRequest(TEvCms::TEvManageRequestRequest::TPtr &ev, bool all, const TActorContext &ctx);

ydb/core/cms/console/console__create_tenant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class TTenantsManager::TTxCreateTenant : public TTransactionBase<TTenantsManager
126126

127127
Tenant->IsExternalSubdomain = Self->FeatureFlags.GetEnableExternalSubdomains();
128128
Tenant->IsExternalHive = Self->FeatureFlags.GetEnableExternalHive();
129-
Tenant->IsExternalSysViewProcessor = Self->FeatureFlags.GetEnablePersistentQueryStats();
129+
Tenant->IsExternalSysViewProcessor = Self->FeatureFlags.GetEnableSystemViews();
130130

131131
if (rec.options().disable_external_subdomain()) {
132132
Tenant->IsExternalSubdomain = false;

ydb/core/cms/json_proxy_sentinel.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,49 @@ class TJsonProxySentinel : public TJsonProxyCms<TEvCms::TEvGetSentinelStateReque
1717
TAutoPtr<TRequest> PrepareRequest(const TActorContext &) override
1818
{
1919
TAutoPtr<TRequest> request = new TRequest;
20+
const TCgiParameters& cgi = RequestEvent->Get()->Request.GetParams();
21+
22+
if (cgi.Has("show")) {
23+
NKikimrCms::TGetSentinelStateRequest::EShow show;
24+
NKikimrCms::TGetSentinelStateRequest::EShow_Parse(cgi.Get("show"), &show);
25+
request->Record.SetShow(show);
26+
}
27+
28+
if (cgi.Has("range")) {
29+
TVector<std::pair<ui32, ui32>> ranges;
30+
auto rangesStr = cgi.Get("range");
31+
TVector<TString> strRanges;
32+
StringSplitter(rangesStr).Split(',').Collect(&strRanges);
33+
for (auto& strRange : strRanges) {
34+
ui32 begin = 0;
35+
ui32 end = 0;
36+
if (!StringSplitter(strRange).Split('-').TryCollectInto(&begin, &end)) {
37+
if (TryFromString<ui32>(strRange, begin)) {
38+
end = begin;
39+
} else {
40+
break; // TODO
41+
}
42+
}
43+
ranges.push_back({begin, end});
44+
}
45+
sort(ranges.begin(), ranges.end());
46+
auto it = ranges.begin();
47+
auto current = *(it)++;
48+
while (it != ranges.end()) {
49+
if (current.second > it->first){
50+
current.second = std::max(current.second, it->second);
51+
} else {
52+
auto* newRange = request->Record.AddRanges();
53+
newRange->SetBegin(current.first);
54+
newRange->SetEnd(current.second);
55+
current = *(it);
56+
}
57+
it++;
58+
}
59+
auto* newRange = request->Record.AddRanges();
60+
newRange->SetBegin(current.first);
61+
newRange->SetEnd(current.second);
62+
}
2063

2164
return request;
2265
}

0 commit comments

Comments
 (0)