From ce42f378a8120fbfcc2ccf08ff7616e8c02068d2 Mon Sep 17 00:00:00 2001
From: cherepashka <cherepashka@yandex-team.com>
Date: Thu, 6 Mar 2025 12:00:20 +0300
Subject: YT-18506: Prerequisite transactions for Sequoia

- Changelog entry
  Type: feature
  Component: master

Introduce prerequisite transactions for read & write requests in Sequoia
commit_hash:3456f4997f34afbd741ade823382faf05fb3ec30
---
 yt/yt/client/object_client/helpers-inl.h | 5 +++++
 yt/yt/client/object_client/helpers.h     | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/yt/yt/client/object_client/helpers-inl.h b/yt/yt/client/object_client/helpers-inl.h
index 000d5b1710..254d5b05b9 100644
--- a/yt/yt/client/object_client/helpers-inl.h
+++ b/yt/yt/client/object_client/helpers-inl.h
@@ -98,6 +98,11 @@ inline bool IsSequoiaId(TObjectId id)
     return (CounterFromId(id) & SequoiaCounterMask) && !IsWellKnownId(id);
 }
 
+inline bool IsCypressTransactionMirroredToSequoia(TTransactionId transactionId)
+{
+    return IsCypressTransactionType(TypeFromId(transactionId)) && IsSequoiaId(transactionId);
+}
+
 inline TObjectId MakeRegularId(
     EObjectType type,
     TCellTag cellTag,
diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h
index 6a4f49c30c..ac2f24714c 100644
--- a/yt/yt/client/object_client/helpers.h
+++ b/yt/yt/client/object_client/helpers.h
@@ -151,6 +151,9 @@ bool IsWellKnownId(TObjectId id);
  */
 bool IsSequoiaId(TObjectId id);
 
+//! Returns |true| if a given #id corresponds to cypress transaction that is mirrored to Sequoia.
+bool IsCypressTransactionMirroredToSequoia(TTransactionId transactionId);
+
 //! Constructs the id for a regular object.
 TObjectId MakeRegularId(
     EObjectType type,
-- 
cgit v1.2.3