aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkvk1920 <kvk1920@yandex-team.com>2024-09-05 20:53:33 +0300
committerkvk1920 <kvk1920@yandex-team.com>2024-09-05 21:02:31 +0300
commitc6547c4b4f05821c35928bc0d50883ab625a30b0 (patch)
tree5c42c81da796b3a4eb15a4a355b7a4d8f6d19863
parent74184a40c15dc0649a769d9754d0ce7efb44db04 (diff)
downloadydb-c6547c4b4f05821c35928bc0d50883ab625a30b0.tar.gz
Native transaction externalization/replication
In Sequoia we need to distinguish replication and externalization due to different interaction ways: transaction’s replicas are finished via 2PC and externalized ones are finished via Hive. Unfortunately, native transactions are always replicated even if externalization was requested. This commit fixes it. e46c3b5587c705d93d1943c41143364da2c43df6
-rw-r--r--yt/yt/client/object_client/helpers.cpp7
-rw-r--r--yt/yt/client/object_client/helpers.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/yt/yt/client/object_client/helpers.cpp b/yt/yt/client/object_client/helpers.cpp
index 19a72ec4fa..8a4021db28 100644
--- a/yt/yt/client/object_client/helpers.cpp
+++ b/yt/yt/client/object_client/helpers.cpp
@@ -285,6 +285,13 @@ bool IsUploadTransactionType(EObjectType type)
type == EObjectType::UploadNestedTransaction;
}
+bool IsExternalizedTransactionType(EObjectType type)
+{
+ return
+ type == EObjectType::ExternalizedTransaction ||
+ type == EObjectType::ExternalizedNestedTransaction;
+}
+
bool IsCompositeNodeType(EObjectType type)
{
return
diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h
index f590b095d0..beb88972e3 100644
--- a/yt/yt/client/object_client/helpers.h
+++ b/yt/yt/client/object_client/helpers.h
@@ -77,6 +77,9 @@ bool IsSystemTransactionType(EObjectType type);
//! Checks if the given type if an upload transaction.
bool IsUploadTransactionType(EObjectType type);
+//! Checks if the given type is an externalized Cypress transaction.
+bool IsExternalizedTransactionType(EObjectType type);
+
//! Checks if node with the given type can contain other nodes.
bool IsCompositeNodeType(EObjectType type);