Skip to content

Backport of ydb-ent fixes on top of stable-24-4 #20710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: stable-24-4-enterprise
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
814e377
Release notes 24.4.4.12 (#19113)
galnat Jun 16, 2025
9920c38
Release notes 24.4.4.12 (#19113) (#19704)
lopatinevgeny Jun 17, 2025
f56ba50
Fixed cleanup supprotive partition
nshestakov Jun 19, 2025
b3438d4
fix
nshestakov Jun 20, 2025
bd9fda7
Fixed the deletion of blobs by retention in the supportive partition …
nshestakov Jun 20, 2025
b160809
[+] service PQ_TX
Alek5andr-Kotov Jun 20, 2025
12002b7
[-] flag tx.WriteInProgress
Alek5andr-Kotov Jun 22, 2025
6a32a47
The PQ tablet did not receive a TEvReadSet (#20074)
Alek5andr-Kotov Jun 24, 2025
fa4c2b8
[+] command SendReadSet
Alek5andr-Kotov Jun 24, 2025
8a657d8
Optimize the writing session creation time (#19807)
Alek5andr-Kotov Jun 18, 2025
c8274cd
[*] unnecessary SchemeCache calls
Alek5andr-Kotov Jun 23, 2025
a12b16a
[+] logging
Alek5andr-Kotov Jun 23, 2025
3a2960e
[+] cache for SchemeNavigate
Alek5andr-Kotov Jun 23, 2025
2576196
[*] cache for SchemeNavigate
Alek5andr-Kotov Jun 24, 2025
b72beea
[/] logging
Alek5andr-Kotov Jun 24, 2025
f3058fc
[*] log level
Alek5andr-Kotov Jun 24, 2025
dec1411
[*] disable test
Alek5andr-Kotov Jun 25, 2025
0df1c84
Optimize the writing session creation time (#19807) (#19839)
Alek5andr-Kotov Jun 25, 2025
5c47e33
HTTP-command SendReadSet (#20119)
Alek5andr-Kotov Jun 25, 2025
2c5658e
merge
blinkov Jul 1, 2025
1941e33
merge
blinkov Jul 1, 2025
1235ce7
Update .yfm
blinkov Jul 1, 2025
520358b
[docs/stable-24-4] disable GTM (#20414)
blinkov Jul 2, 2025
701ca49
Support fetching blob data through JSON query (#20313)
alexvru Jun 27, 2025
66c0dc4
Support fetching blob data through JSON query (#20313) by alexvru (#2…
serbel324 Jul 3, 2025
4178496
Merge remote-tracking branch 'upstream/stable-24-4' into stable-24-4-…
zinal Jul 7, 2025
07bbcbb
avoid allocating data on TTypeEnv when making cell vectors (#12552)
gridnevvvit Dec 12, 2024
ad2e52e
KIKIMR-22403 fix s3 client thread pool creation (#12963)
zinal Dec 27, 2024
6b01cbc
[TKqpExecuter] if got poisoned - die silently (#11286)
abyss7 Nov 11, 2024
70cf25c
Enable arena-based allocations for QueryService output rows (#13174)
zinal Jan 13, 2025
663c3f6
fix(kqp): stream lookup worker should cache left row type descriptor …
zinal May 20, 2025
18651f7
Increase QUERY_TEXT_LIMIT for query stats to 10KB. (#15186) (#15221)
spuchin Mar 2, 2025
239baaf
Fix lock hash type (#14379)
nikvas0 Feb 10, 2025
c313bf0
24-4, VIEW: use parent context for query AST building (#15590)
jepett0 Mar 13, 2025
492cb73
24-4: Add CleanupEC2MetadataClient() (#15382)
CyberROFL Mar 6, 2025
65e857b
Refresh ldap token with error (#15182)
molotkov-and Mar 4, 2025
fa7998c
experimental patch to stop the influence of lock ranges count over lo…
zinal Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ydb/core/blobstorage/vdisk/protos/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ message LogoBlobIdRange {
message GetLogoBlobRequest {
LogoBlobIdRange range = 1;
bool show_internals = 5;
bool need_data = 6;
};

message GetLogoBlobResponse {
message LogoBlob {
string status = 1;
optional string ingress = 2;
string id = 3;
optional string data_base64 = 4;
};

repeated LogoBlob logoblobs = 1;
Expand Down
13 changes: 10 additions & 3 deletions ydb/core/blobstorage/vdisk/skeleton/blobstorage_monactors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ namespace NKikimr {
TSkeletonFrontMonLogoBlobsQueryParams params{
.DbName = "",
.Form = "",
.IndexOnly = true,
.IndexOnly = !record.need_data(),
.ShowInternals = record.show_internals(),
.SubmitButton = true,
.AllButton = false,
Expand All @@ -368,6 +368,9 @@ namespace NKikimr {
auto &range = record.range();
params.From = convert(range.from());
params.To = convert(range.to());
if (params.To == params.From) {
params.To.Clear();
}

return params;
}
Expand Down Expand Up @@ -479,14 +482,18 @@ namespace NKikimr {
}
}

void OutputOneQueryResultToProto(NKikimrVDisk::GetLogoBlobResponse::LogoBlob *blob, const NKikimrBlobStorage::TQueryResult &q) {
void OutputOneQueryResultToProto(NKikimrVDisk::GetLogoBlobResponse::LogoBlob *blob, const NKikimrBlobStorage::TQueryResult &q,
TEvBlobStorage::TEvVGetResult *ev) {
TLogoBlobID id = LogoBlobIDFromLogoBlobID(q.GetBlobID());
blob->set_id(id.ToString());
blob->set_status(NKikimrProto::EReplyStatus_Name(q.GetStatus()));
if (ShowInternals) {
TIngress ingress(q.GetIngress());
blob->set_ingress(ingress.ToString(Top.get(), TVDiskIdShort(SelfVDiskId), id));
}
if (TRope data = ev->GetBlobData(q)) {
blob->set_data_base64(Base64Encode(data.ConvertToString()));
}
}


Expand Down Expand Up @@ -521,7 +528,7 @@ namespace NKikimr {
} else {
auto res = std::make_unique<TEvGetLogoBlobResponse>();
for (ui32 i = 0; i < size; i++) {
OutputOneQueryResultToProto(res->Record.add_logoblobs(), rec.GetResult(i));
OutputOneQueryResultToProto(res->Record.add_logoblobs(), rec.GetResult(i), ev->Get());
}
Finish(ctx, res.release());
}
Expand Down
27 changes: 5 additions & 22 deletions ydb/core/driver_lib/run/kikimr_services_initializers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
#include <ydb/core/tx/long_tx_service/public/events.h>
#include <ydb/core/tx/long_tx_service/long_tx_service.h>

#include <ydb/core/util/aws.h>
#include <ydb/core/util/failure_injection.h>
#include <ydb/core/util/memory_tracker.h>
#include <ydb/core/util/sig.h>
Expand Down Expand Up @@ -244,32 +245,17 @@

#include <util/system/hostname.h>

#ifndef KIKIMR_DISABLE_S3_OPS
#include <aws/core/Aws.h>
#endif

namespace {
namespace NKikimr::NKikimrServicesInitializers {

#ifndef KIKIMR_DISABLE_S3_OPS
struct TAwsApiGuard {
TAwsApiGuard() {
Aws::InitAPI(Options);
InitAwsAPI();
}

~TAwsApiGuard() {
Aws::ShutdownAPI(Options);
ShutdownAwsAPI();
}

private:
Aws::SDKOptions Options;
};
#endif

}

namespace NKikimr {

namespace NKikimrServicesInitializers {

ui32 TFederatedQueryInitializer::IcPort = 0;

Expand Down Expand Up @@ -2884,7 +2870,6 @@ void TGraphServiceInitializer::InitializeServices(NActors::TActorSystemSetup* se
TActorSetupCmd(NGraph::CreateGraphService(appData->TenantName), TMailboxType::HTSwap, appData->UserPoolId));
}

#ifndef KIKIMR_DISABLE_S3_OPS
TAwsApiInitializer::TAwsApiInitializer(IGlobalObjectStorage& globalObjects)
: GlobalObjects(globalObjects)
{
Expand All @@ -2895,7 +2880,5 @@ void TAwsApiInitializer::InitializeServices(NActors::TActorSystemSetup* setup, c
Y_UNUSED(appData);
GlobalObjects.AddGlobalObject(std::make_shared<TAwsApiGuard>());
}
#endif

} // namespace NKikimrServicesInitializers
} // namespace NKikimr
} // namespace NKikimr::NKikimrServicesInitializers
2 changes: 0 additions & 2 deletions ydb/core/driver_lib/run/kikimr_services_initializers.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ class TGraphServiceInitializer : public IKikimrServicesInitializer {
void InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) override;
};

#ifndef KIKIMR_DISABLE_S3_OPS
class TAwsApiInitializer : public IServiceInitializer {
IGlobalObjectStorage& GlobalObjects;

Expand All @@ -627,7 +626,6 @@ class TAwsApiInitializer : public IServiceInitializer {

void InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) override;
};
#endif

} // namespace NKikimrServicesInitializers
} // namespace NKikimr
2 changes: 0 additions & 2 deletions ydb/core/driver_lib/run/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1685,11 +1685,9 @@ TIntrusivePtr<TServiceInitializersList> TKikimrRunner::CreateServiceInitializers
sil->AddServiceInitializer(new TGraphServiceInitializer(runConfig));
}

#ifndef KIKIMR_DISABLE_S3_OPS
if (serviceMask.EnableAwsService) {
sil->AddServiceInitializer(new TAwsApiInitializer(*this));
}
#endif

return sil;
}
Expand Down
10 changes: 0 additions & 10 deletions ydb/core/driver_lib/run/ya.make
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
LIBRARY(run)

IF (OS_WINDOWS)
CFLAGS(
-DKIKIMR_DISABLE_S3_OPS
)
ELSE()
PEERDIR(
contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core
)
ENDIF()

SRCS(
auto_config_initializer.cpp
config.cpp
Expand Down
21 changes: 19 additions & 2 deletions ydb/core/engine/mkql_keys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ THolder<TKeyDesc> ExtractEraseRow(TCallable& callable, const TTypeEnvironment& e
#define MAKE_PRIMITIVE_TYPE_CELL(type, layout) \
case NUdf::TDataType<type>::Id: return MakeCell<layout>(value);

TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TTypeEnvironment& env, bool copy,

template<typename TStringBackend>
TCell MakeCellImpl(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TStringBackend& env, bool copy,
i32 typmod, TMaybe<TString>* error)
{
if (!value)
Expand Down Expand Up @@ -300,6 +302,21 @@ TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
return TCell(val.Data(), val.Size());
}

TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TTypeEnvironment& env, bool copy,
i32 typmod, TMaybe<TString>* error)
{
return MakeCellImpl(type, value, env, copy, typmod, error);
}

TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TStringProviderBackend& env, bool copy,
i32 typmod, TMaybe<TString>* error)
{
return MakeCellImpl(type, value, env, copy, typmod, error);
}


#undef MAKE_PRIMITIVE_TYPE_CELL

TReadTarget ExtractFlatReadTarget(TRuntimeNode modeInput) {
Expand Down
38 changes: 38 additions & 0 deletions ydb/core/engine/mkql_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,48 @@ TCell MakeCell(const NUdf::TUnboxedValuePod& value) {
return TCell(reinterpret_cast<const char*>(&v), sizeof(v));
}

struct TStringProviderBackend {
mutable TMemoryPool MemoryPool;

TStringProviderBackend()
: MemoryPool(256)
{}

class TMutableStringData {
friend struct TStringProviderBackend;

private:
char* Data_;
size_t Size_ = 0;

explicit TMutableStringData(char* data, size_t size)
: Data_(data)
, Size_(size)
{}

public:
char *Data() const noexcept {
return Data_;
}

size_t Size() const noexcept {
return Size_;
}
};

TMutableStringData NewString(ui32 size) const {
return TMutableStringData(reinterpret_cast<char*>(MemoryPool.Allocate(size)), size);
}
};

TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TTypeEnvironment& env, bool copy = true,
i32 typmod = -1, TMaybe<TString>* error = {});

TCell MakeCell(NScheme::TTypeInfo type, const NUdf::TUnboxedValuePod& value,
const TStringProviderBackend& env, bool copy = true,
i32 typmod = -1, TMaybe<TString>* error = {});

void FillKeyTupleValue(const NUdf::TUnboxedValue& row, const TVector<ui32>& rowIndices,
const TVector<NScheme::TTypeInfo>& rowTypes, TVector<TCell>& cells, const TTypeEnvironment& env);

Expand Down
10 changes: 5 additions & 5 deletions ydb/core/grpc_services/query/rpc_execute_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,13 @@ class TExecuteQueryRPC : public TActorBootstrapped<TExecuteQueryRPC> {
}

void Handle(NKqp::TEvKqpExecuter::TEvStreamData::TPtr& ev, const TActorContext& ctx) {
Ydb::Query::ExecuteQueryResponsePart response;
response.set_status(Ydb::StatusIds::SUCCESS);
response.set_result_set_index(ev->Get()->Record.GetQueryResultIndex());
response.mutable_result_set()->Swap(ev->Get()->Record.MutableResultSet());
Ydb::Query::ExecuteQueryResponsePart *response = ev->Get()->Arena->Allocate<Ydb::Query::ExecuteQueryResponsePart>();
response->set_status(Ydb::StatusIds::SUCCESS);
response->set_result_set_index(ev->Get()->Record.GetQueryResultIndex());
response->mutable_result_set()->Swap(ev->Get()->Record.MutableResultSet());

TString out;
Y_PROTOBUF_SUPPRESS_NODISCARD response.SerializeToString(&out);
Y_PROTOBUF_SUPPRESS_NODISCARD response->SerializeToString(&out);

FlowControl_.PushResponse(out.size());
const i64 freeSpaceBytes = FlowControl_.FreeSpaceBytes();
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/compute_actor/kqp_scan_compute_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TKqpScanComputeActor: public TSchedulableComputeActorBase<TKqpScanComputeA
const ui32 LockNodeId;

struct TLockHash {
bool operator()(const NKikimrDataEvents::TLock& lock) {
size_t operator()(const NKikimrDataEvents::TLock& lock) {
return MultiHash(
lock.GetLockId(),
lock.GetDataShard(),
Expand Down
13 changes: 12 additions & 1 deletion ydb/core/kqp/executer_actor/kqp_data_executer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2676,8 +2676,9 @@ class TKqpDataExecuter: public TKqpExecuterBase<TKqpDataExecuter, EExecType::Dat
hFunc(TEvDqCompute::TEvState, HandleShutdown);
hFunc(TEvInterconnect::TEvNodeDisconnected, HandleShutdown);
hFunc(TEvents::TEvPoison, HandleShutdown);
hFunc(TEvDq::TEvAbortExecution, HandleShutdown);
default:
LOG_E("Unexpected event: " << ev->GetTypeName()); // ignore all other events
LOG_E("Unexpected event while waiting for shutdown: " << ev->GetTypeName()); // ignore all other events
}
}

Expand Down Expand Up @@ -2719,6 +2720,16 @@ class TKqpDataExecuter: public TKqpExecuterBase<TKqpDataExecuter, EExecType::Dat
}
}

void HandleShutdown(TEvDq::TEvAbortExecution::TPtr& ev) {
auto statusCode = NYql::NDq::DqStatusToYdbStatus(ev->Get()->Record.GetStatusCode());

// In case of external timeout the response is already sent to the client - no need to wait for stats.
if (statusCode == Ydb::StatusIds::TIMEOUT) {
LOG_I("External timeout while waiting for Compute Actors to finish - forcing shutdown. Sender: " << ev->Sender);
PassAway();
}
}

private:
void ReplyTxStateUnknown(ui64 shardId) {
auto message = TStringBuilder() << "Tx state unknown for shard " << shardId << ", txid " << TxId;
Expand Down
11 changes: 9 additions & 2 deletions ydb/core/kqp/executer_actor/kqp_executer.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ struct TEvKqpExecuter {
}
};

struct TEvStreamData : public TEventPB<TEvStreamData, NKikimrKqp::TEvExecuterStreamData,
TKqpExecuterEvents::EvStreamData> {};
struct TEvStreamData : public TEventPBWithArena<TEvStreamData, NKikimrKqp::TEvExecuterStreamData, TKqpExecuterEvents::EvStreamData> {
using TBaseEv = TEventPBWithArena<TEvStreamData, NKikimrKqp::TEvExecuterStreamData, TKqpExecuterEvents::EvStreamData>;
using TBaseEv::TEventPBBase;

TEvStreamData() = default;
explicit TEvStreamData(TIntrusivePtr<NActors::TProtoArenaHolder> arena)
: TEventPBBase(std::move(arena))
{}
};

struct TEvStreamDataAck : public TEventPB<TEvStreamDataAck, NKikimrKqp::TEvExecuterStreamDataAck,
TKqpExecuterEvents::EvStreamDataAck>
Expand Down
20 changes: 14 additions & 6 deletions ydb/core/kqp/executer_actor/kqp_executer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,15 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
batch.Payload = std::move(computeData.Payload);

TKqpProtoBuilder protoBuilder{*AppData()->FunctionRegistry};
auto resultSet = protoBuilder.BuildYdbResultSet(std::move(batches), txResult.MkqlItemType, txResult.ColumnOrder);

if (!trailingResults) {
auto streamEv = MakeHolder<TEvKqpExecuter::TEvStreamData>();
streamEv->Record.SetSeqNo(computeData.Proto.GetSeqNo());
streamEv->Record.SetQueryResultIndex(*txResult.QueryResultIndex + StatementResultIndex);
streamEv->Record.SetChannelId(channel.Id);
streamEv->Record.MutableResultSet()->Swap(&resultSet);

protoBuilder.BuildYdbResultSet(*streamEv->Record.MutableResultSet(), std::move(batches),
txResult.MkqlItemType, txResult.ColumnOrder);

LOG_D("Send TEvStreamData to " << Target << ", seqNo: " << streamEv->Record.GetSeqNo()
<< ", nRows: " << streamEv->Record.GetResultSet().rows().size());
Expand All @@ -314,8 +315,11 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
ackEv->Record.SetChannelId(channel.Id);
ackEv->Record.SetFreeSpace(50_MB);
this->Send(channelComputeActorId, ackEv.Release(), /* TODO: undelivery */ 0, /* cookie */ channel.Id);
txResult.TrailingResult.Swap(&resultSet);

protoBuilder.BuildYdbResultSet(txResult.TrailingResult, std::move(batches),
txResult.MkqlItemType, txResult.ColumnOrder);
txResult.HasTrailingResult = true;

LOG_D("staging TEvStreamData to " << Target << ", seqNo: " << computeData.Proto.GetSeqNo()
<< ", nRows: " << txResult.TrailingResult.rows().size());
}
Expand Down Expand Up @@ -1629,9 +1633,13 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {

protected:
void UnexpectedEvent(const TString& state, ui32 eventType) {
LOG_C("TKqpExecuter, unexpected event: " << eventType << ", at state:" << state << ", selfID: " << this->SelfId());
InternalError(TStringBuilder() << "Unexpected event at TKqpExecuter, state: " << state
<< ", event: " << eventType);
if (eventType == TEvents::TEvPoison::EventType) {
LOG_D("TKqpExecuter, TEvPoison event at state:" << state << ", selfID: " << this->SelfId());
InternalError(TStringBuilder() << "TKqpExecuter got poisoned, state: " << state);
} else {
LOG_E("TKqpExecuter, unexpected event: " << eventType << ", at state:" << state << ", selfID: " << this->SelfId());
InternalError(TStringBuilder() << "Unexpected event at TKqpExecuter, state: " << state << ", event: " << eventType);
}
}

void InternalError(const NYql::TIssues& issues) {
Expand Down
7 changes: 3 additions & 4 deletions ydb/core/kqp/executer_actor/kqp_result_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,12 @@ class TResultStreamChannelProxy : public TResultCommonChannelProxy {
batch.Proto = std::move(*computeData.Proto.MutableChannelData()->MutableData());
batch.Payload = std::move(computeData.Payload);

TKqpProtoBuilder protoBuilder{*AppData()->FunctionRegistry};
auto resultSet = protoBuilder.BuildYdbResultSet(std::move(batches), ItemType, ColumnOrder);

auto streamEv = MakeHolder<TEvKqpExecuter::TEvStreamData>();
streamEv->Record.SetSeqNo(computeData.Proto.GetSeqNo());
streamEv->Record.SetQueryResultIndex(QueryResultIndex + StatementResultIndex);
streamEv->Record.MutableResultSet()->Swap(&resultSet);

TKqpProtoBuilder protoBuilder{*AppData()->FunctionRegistry};
protoBuilder.BuildYdbResultSet(*streamEv->Record.MutableResultSet(), std::move(batches), ItemType, ColumnOrder);

LOG_DEBUG_S(*NActors::TlsActivationContext, NKikimrServices::KQP_EXECUTER,
"Send TEvStreamData to " << Target << ", seqNo: " << streamEv->Record.GetSeqNo()
Expand Down
Loading
Loading