Skip to content
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

EvWrite: Immediate & Prepare #10913

Merged
merged 72 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
70e1524
move
nikvas0 Sep 8, 2024
26030c9
fix
nikvas0 Sep 8, 2024
b0f705a
fix
nikvas0 Sep 8, 2024
0ad8caa
fix
nikvas0 Sep 9, 2024
0a6e516
fix
nikvas0 Sep 20, 2024
25211b1
fix
nikvas0 Sep 20, 2024
8ef8933
fix
nikvas0 Sep 20, 2024
0b1c1fd
fix
nikvas0 Sep 20, 2024
e82a5e9
fix
nikvas0 Sep 20, 2024
1392368
fix
nikvas0 Sep 20, 2024
e6b486a
fix
nikvas0 Sep 21, 2024
2dceb3b
fix
nikvas0 Sep 21, 2024
be4131a
buffer
nikvas0 Sep 21, 2024
b4c26b7
bufferactorid
nikvas0 Sep 21, 2024
2ceb5bd
fix
nikvas0 Sep 21, 2024
da19b5b
immediate-commit
nikvas0 Sep 22, 2024
32a1cc6
fix
nikvas0 Sep 23, 2024
b884efb
txmanager
nikvas0 Sep 23, 2024
e038215
fix
nikvas0 Sep 23, 2024
06d6be3
fix
nikvas0 Sep 23, 2024
1031e3f
fix
nikvas0 Sep 23, 2024
3292196
fix
nikvas0 Sep 24, 2024
d732632
fix
nikvas0 Sep 24, 2024
d8de81e
get-rid-of-old-locks-check
nikvas0 Sep 24, 2024
346ae67
fix
nikvas0 Sep 24, 2024
d290b7a
prepare-and-rollback
nikvas0 Sep 24, 2024
f2252ed
rollback
nikvas0 Sep 24, 2024
4f8bf6a
fix
nikvas0 Sep 24, 2024
074f9d6
fix
nikvas0 Sep 24, 2024
1cff0e8
fix
nikvas0 Sep 25, 2024
0954895
fix
nikvas0 Sep 25, 2024
736abbd
fix
nikvas0 Sep 25, 2024
f203466
volatile
nikvas0 Sep 26, 2024
d30d601
fix
nikvas0 Sep 26, 2024
f627f59
fix
nikvas0 Sep 27, 2024
e7e7007
disable-resharding
nikvas0 Sep 27, 2024
39e25cc
fix
nikvas0 Sep 27, 2024
b100c2f
improvements-control
nikvas0 Sep 30, 2024
26ed62e
fix
nikvas0 Sep 30, 2024
a01699f
fix
nikvas0 Sep 30, 2024
0b46a19
fix
nikvas0 Oct 1, 2024
2a74412
return-batching
nikvas0 Oct 1, 2024
da5a44e
fix
nikvas0 Oct 1, 2024
3de12ed
fix
nikvas0 Oct 1, 2024
612f022
return
nikvas0 Oct 2, 2024
2b7eb2d
fix
nikvas0 Oct 2, 2024
6839b32
fix
nikvas0 Oct 2, 2024
5243976
fix
nikvas0 Oct 2, 2024
5de7d2b
fix
nikvas0 Oct 2, 2024
f4940d0
fixes
nikvas0 Oct 3, 2024
abab17e
fix
nikvas0 Oct 3, 2024
eb1f333
fix
nikvas0 Oct 4, 2024
baa5ff0
fix
nikvas0 Oct 6, 2024
2263552
remove build locks
nikvas0 Oct 7, 2024
1ccdaa1
flush
nikvas0 Oct 8, 2024
beab1ac
use-immediate-effects
nikvas0 Oct 9, 2024
e145685
fix
nikvas0 Oct 13, 2024
f736fdf
logs
nikvas0 Oct 17, 2024
2263cf5
Merge branch 'main' into actor-buffer-part-1
nikvas0 Oct 17, 2024
cfdf04f
fix
nikvas0 Oct 17, 2024
4ab75df
fix
nikvas0 Oct 18, 2024
2ab5e66
Merge branch 'main' into actor-buffer-part-1
nikvas0 Oct 18, 2024
9fed58a
fix
nikvas0 Oct 24, 2024
1208a66
fix
nikvas0 Oct 25, 2024
d571a09
fix
nikvas0 Oct 25, 2024
0956faa
fix
nikvas0 Oct 28, 2024
45409fa
fix
nikvas0 Oct 28, 2024
335c588
fix
nikvas0 Oct 28, 2024
64c1cd3
fix
nikvas0 Oct 29, 2024
8a283a0
fix
nikvas0 Oct 29, 2024
16e5426
fix
nikvas0 Oct 29, 2024
537db8e
fix
nikvas0 Oct 29, 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
17 changes: 17 additions & 0 deletions ydb/core/kqp/common/buffer/buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <ydb/core/scheme/scheme_tabledefs.h>
#include <ydb/core/kqp/common/kqp_tx_manager.h>

namespace NKikimr {
namespace NKqp {

struct TKqpBufferWriterSettings {
TActorId SessionActorId;
IKqpTransactionManagerPtr TxManager;
};

NActors::IActor* CreateKqpBufferWriterActor(TKqpBufferWriterSettings&& settings);

}
}
16 changes: 16 additions & 0 deletions ydb/core/kqp/common/buffer/events.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "events.h"

namespace NKikimr {
namespace NKqp {

TEvKqpBuffer::TEvError::TEvError(
const TString& message,
NYql::NDqProto::StatusIds::StatusCode statusCode,
const NYql::TIssues& subIssues)
: Message(message)
, StatusCode(statusCode)
, SubIssues(subIssues) {
}

}
}
47 changes: 47 additions & 0 deletions ydb/core/kqp/common/buffer/events.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma once

#include <ydb/core/kqp/common/simple/kqp_event_ids.h>
#include <ydb/library/yql/dq/actors/protos/dq_status_codes.pb.h>
#include <ydb/library/yql/public/issue/yql_issue.h>


namespace NKikimr {
namespace NKqp {

struct TEvKqpBuffer {

struct TEvPrepare : public TEventLocal<TEvPrepare, TKqpBufferWriterEvents::EvPrepare> {
TActorId ExecuterActorId;
};

struct TEvCommit : public TEventLocal<TEvCommit, TKqpBufferWriterEvents::EvCommit> {
TActorId ExecuterActorId;
ui64 TxId;
};

struct TEvRollback : public TEventLocal<TEvRollback, TKqpBufferWriterEvents::EvRollback> {
TActorId ExecuterActorId;
};

struct TEvFlush : public TEventLocal<TEvFlush, TKqpBufferWriterEvents::EvFlush> {
TActorId ExecuterActorId;
};

struct TEvResult : public TEventLocal<TEvResult, TKqpBufferWriterEvents::EvResult> {
};

struct TEvError : public TEventLocal<TEvError, TKqpBufferWriterEvents::EvError> {
TString Message;
NYql::NDqProto::StatusIds::StatusCode StatusCode;
NYql::TIssues SubIssues;

TEvError(const TString& message, NYql::NDqProto::StatusIds::StatusCode statusCode, const NYql::TIssues& subIssues);
};

struct TEvTerminate : public TEventLocal<TEvTerminate, TKqpBufferWriterEvents::EvTerminate> {
};

};

}
}
14 changes: 14 additions & 0 deletions ydb/core/kqp/common/buffer/ya.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
LIBRARY()

SRCS(
events.cpp
)

PEERDIR(
ydb/core/kqp/common/simple
ydb/library/yql/public/issue
)

YQL_LAST_ABI_VERSION()

END()
12 changes: 6 additions & 6 deletions ydb/core/kqp/common/kqp_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <ydb/core/base/feature_flags.h>
#include <ydb/core/kqp/common/kqp_yql.h>
#include <ydb/core/kqp/common/kqp_tx_manager.h>
#include <ydb/core/kqp/gateway/kqp_gateway.h>
#include <ydb/core/kqp/provider/yql_kikimr_provider.h>

Expand Down Expand Up @@ -121,12 +122,6 @@ struct TDeferredEffects {
friend class TKqpTransactionContext;
};

struct TTableInfo {
bool IsOlap = false;
THashSet<TStringBuf> Pathes;
};


class TShardIdToTableInfo {
public:
const TTableInfo& Get(ui64 shardId) const {
Expand Down Expand Up @@ -204,6 +199,8 @@ class TKqpTransactionContext : public NYql::TKikimrTransactionContextBase {
void Finish() final {
YQL_ENSURE(DeferredEffects.Empty());
YQL_ENSURE(!Locks.HasLocks());
YQL_ENSURE(!TxManager);
YQL_ENSURE(!BufferActorId);

FinishTime = TInstant::Now();

Expand Down Expand Up @@ -351,6 +348,9 @@ class TKqpTransactionContext : public NYql::TKikimrTransactionContextBase {
bool NeedUncommittedChangesFlush = false;
THashSet<NKikimr::TTableId> ModifiedTablesSinceLastFlush;

TActorId BufferActorId;
IKqpTransactionManagerPtr TxManager = nullptr;

TShardIdToTableInfoPtr ShardIdToTableInfo = std::make_shared<TShardIdToTableInfo>();
};

Expand Down
Loading
Loading