aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <snaury@ydb.tech>2023-07-31 15:52:15 +0300
committersnaury <snaury@ydb.tech>2023-07-31 15:52:15 +0300
commit68cf571393094f43bac88208cbefc56ef042dc10 (patch)
tree50602290ba3a06ed21bd46a5f1d2622493c89a65
parent7155473fb8810c965911d3ffc38a44dd8618a36e (diff)
downloadydb-68cf571393094f43bac88208cbefc56ef042dc10.tar.gz
Add proto flags for volatile transactions KIKIMR-18580
-rw-r--r--ydb/core/protos/tx.proto17
-rw-r--r--ydb/core/tx/tx.h8
2 files changed, 21 insertions, 4 deletions
diff --git a/ydb/core/protos/tx.proto b/ydb/core/protos/tx.proto
index de069bda69..b5aed52769 100644
--- a/ydb/core/protos/tx.proto
+++ b/ydb/core/protos/tx.proto
@@ -8,6 +8,21 @@ option java_package = "ru.yandex.kikimr.proto";
// smth to coordinator
message TProxyTransaction {
+ enum EFlags {
+ // Set for volatile transactions.
+ // Volatile transactions are not guaranteed to reach participants,
+ // and may be discarded at any time during execution, which will
+ // cause transaction to abort.
+ FLAG_VOLATILE = 1;
+ }
+
+ enum EAffectedFlags {
+ // Transaction performs reads at the given participant
+ FLAG_AFFECTED_READ = 1;
+ // Transaction performs writes at the given participant
+ FLAG_AFFECTED_WRITE = 2;
+ }
+
message TAffectedEntry {
optional fixed64 TabletId = 1;
optional uint32 Flags = 2; // 8 bit int, 1 - read-set, 2 - write-set
@@ -23,6 +38,8 @@ message TProxyTransaction {
optional uint64 MaxStep = 7; // not plan after
optional bool IgnoreLowDiskSpace = 8; // plan even disk space is low
+
+ optional uint32 Flags = 9;
}
message TEvProposeTransaction {
diff --git a/ydb/core/tx/tx.h b/ydb/core/tx/tx.h
index 5c74fce9aa..8a5a32f4b0 100644
--- a/ydb/core/tx/tx.h
+++ b/ydb/core/tx/tx.h
@@ -31,10 +31,10 @@ struct TEvTxProxy {
static_assert(EvEnd < EventSpaceEnd(TKikimrEvents::ES_TX_PROXY), "expect EvEnd < EventSpaceEnd(TKikimrEvents::ES_TX_PROXY)");
struct TEvProposeTransaction : public TEventPB<TEvProposeTransaction, NKikimrTx::TEvProposeTransaction, EvProposeTransaction> {
- enum {
- AffectedRead = 1 << 0,
- AffectedWrite = 1 << 1,
- };
+ static constexpr ui32 FlagVolatile = NKikimrTx::TProxyTransaction::FLAG_VOLATILE;
+
+ static constexpr ui32 AffectedRead = NKikimrTx::TProxyTransaction::FLAG_AFFECTED_READ;
+ static constexpr ui32 AffectedWrite = NKikimrTx::TProxyTransaction::FLAG_AFFECTED_WRITE;
TEvProposeTransaction() = default;