Skip to content

Commit

Permalink
Add OLAP support with topics in BufferWriteActor (ydb-platform#12686)
Browse files Browse the repository at this point in the history
  • Loading branch information
dahbka-lis authored Dec 25, 2024
1 parent 308501b commit 97167eb
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 46 deletions.
1 change: 0 additions & 1 deletion ydb/core/kqp/runtime/kqp_write_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,6 @@ class TKqpBufferWriteActor :public TActorBootstrapped<TKqpBufferWriteActor>, pub
State = EState::WRITING;
Alloc->Release();
Counters->BufferActorsCount->Inc();
TxManager->AddTopicsToShards();
}

void Bootstrap() {
Expand Down
4 changes: 4 additions & 0 deletions ydb/core/kqp/session_actor/kqp_session_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
&& !txCtx->BufferActorId
&& (txCtx->HasTableWrite || request.TopicOperations.GetSize() != 0)) {
txCtx->TxManager->SetTopicOperations(std::move(request.TopicOperations));
txCtx->TxManager->AddTopicsToShards();

TKqpBufferWriterSettings settings {
.SessionActorId = SelfId(),
Expand All @@ -1388,6 +1389,9 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
};
auto* actor = CreateKqpBufferWriterActor(std::move(settings));
txCtx->BufferActorId = RegisterWithSameMailbox(actor);
} else if (Settings.TableService.GetEnableOltpSink() && txCtx->BufferActorId) {
txCtx->TxManager->SetTopicOperations(std::move(request.TopicOperations));
txCtx->TxManager->AddTopicsToShards();
}

auto executerActor = CreateKqpExecuter(std::move(request), Settings.Database,
Expand Down
12 changes: 12 additions & 0 deletions ydb/core/testlib/test_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ namespace Tests {
AppConfig->MutableTableServiceConfig()->SetEnableOltpSink(withOltpSink);
return *this;
}
TServerSettings& SetEnableOlapSink(bool withOlapSink) {
AppConfig->MutableTableServiceConfig()->SetEnableOlapSink(withOlapSink);
return *this;
}
TServerSettings& SetEnableHtapTx(bool withHtapTx) {
AppConfig->MutableTableServiceConfig()->SetEnableHtapTx(withHtapTx);
return *this;
}
TServerSettings& SetAllowOlapDataQuery(bool withAllowOlapDataQuery) {
AppConfig->MutableTableServiceConfig()->SetAllowOlapDataQuery(withAllowOlapDataQuery);
return *this;
}


// Add additional grpc services
Expand Down
Loading

0 comments on commit 97167eb

Please sign in to comment.