summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface
diff options
context:
space:
mode:
authorermolovd <[email protected]>2026-04-28 10:36:20 +0300
committerermolovd <[email protected]>2026-04-28 11:34:34 +0300
commit693274b40b1a9ebdf2da02f2e87fbc8502105738 (patch)
tree229c575c802e7ae1f9290502efce9b5879fbfea3 /yt/cpp/mapreduce/interface
parent10edf8d9197e9c45458d73cb57a601e0827d159c (diff)
YT-27827: TPingerTransaction use BlockingGet instead of WaitFor in destructor
commit_hash:90bbe36635e0d48c81c153567dcedf28f103efbe
Diffstat (limited to 'yt/cpp/mapreduce/interface')
-rw-r--r--yt/cpp/mapreduce/interface/common.cpp19
-rw-r--r--yt/cpp/mapreduce/interface/common.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/common.cpp b/yt/cpp/mapreduce/interface/common.cpp
index fdb3e66b191..7c54fd65d09 100644
--- a/yt/cpp/mapreduce/interface/common.cpp
+++ b/yt/cpp/mapreduce/interface/common.cpp
@@ -13,6 +13,10 @@
#include <util/generic/xrange.h>
+#include <util/datetime/base.h>
+
+#include <util/system/getpid.h>
+
namespace NYT {
using ::google::protobuf::Descriptor;
@@ -762,6 +766,21 @@ TString ToString(EValueType type)
ythrow yexception() << "Invalid value type " << static_cast<int>(type);
}
+TMutationId GenerateMutationId()
+{
+ TGUID guid;
+
+ // Some users use `fork()' with yt wrapper
+ // (actually they use python + multiprocessing)
+ // and CreateGuid is not resistant to `fork()', so spice it a little bit.
+ //
+ // Check IGNIETFERRO-610
+ CreateGuid(&guid);
+ guid.dw[2] = GetPID() ^ MicroSeconds();
+
+ return guid;
+}
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NDetail
diff --git a/yt/cpp/mapreduce/interface/common.h b/yt/cpp/mapreduce/interface/common.h
index 7f09fe4c004..d0339f7baf8 100644
--- a/yt/cpp/mapreduce/interface/common.h
+++ b/yt/cpp/mapreduce/interface/common.h
@@ -1402,6 +1402,8 @@ namespace NDetail {
// TODO: we should use default GENERATE_ENUM_SERIALIZATION
TString ToString(EValueType type);
+TMutationId GenerateMutationId();
+
} // namespace NDetail
/// @endcond