<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/library/cpp/yt, branch main</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=main</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2026-07-21T06:52:42Z</updated>
<entry>
<title>Make THROW_ERROR_EXCEPTION_UNLESS/IF chainable with error attributes</title>
<updated>2026-07-21T06:52:42Z</updated>
<author>
<name>pechatnov</name>
<email>pechatnov@yandex-team.com</email>
</author>
<published>2026-07-21T06:21:36Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b6bda2264da6775be09d9224c82c5b9587e60052'/>
<id>urn:sha1:b6bda2264da6775be09d9224c82c5b9587e60052</id>
<content type='text'>
commit_hash:4e76ece0b75ab787ed04b6be5f183cecbf9b8167
</content>
</entry>
<entry>
<title>Unpoison use-after-dtor access to ref counter</title>
<updated>2026-07-17T10:21:08Z</updated>
<author>
<name>makxenov</name>
<email>makxenov@yandex-team.com</email>
</author>
<published>2026-07-16T17:48:23Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=bcb14ace638c50d3f0530f65ce3e9ad1e7b3d361'/>
<id>urn:sha1:bcb14ace638c50d3f0530f65ce3e9ad1e7b3d361</id>
<content type='text'>
Two scenarios addressed:

- Access to ref counters after explicit destructor of an object
- Access to vptr for upcast of an already destroyed object
commit_hash:a8f27500111817f325832d006feb3ce6c3c830f1
</content>
</entry>
<entry>
<title>YT-28451: Add tagged logging API and opaque event payload</title>
<updated>2026-07-17T09:07:46Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-07-16T07:32:17Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=cc4f0cb52cee106a1e84c653823087861b8c8df5'/>
<id>urn:sha1:cc4f0cb52cee106a1e84c653823087861b8c8df5</id>
<content type='text'>
Replace `TLogEvent::MessageRef` with an opaque `Payload` that carries the message
together with structured key/value tags, deferring tag rendering to the consumer
(logging thread).

- Add the `TTaggedPayloadWriter`/`TTaggedPayloadReader` codec (`NDetail`), with a
  per-thread chunk-cached builder so tagged logging does no per-message heap
  allocation.
- Model the payload as a typed `TLogEventPayload` — a `std::variant` of the opaque
  strong typedefs `TTaggedLogEventPayload` and `TStructuredLogEventPayload` (each
  over `TSharedRef`). The active alternative identifies the event kind, so the
  separate `ELogMessageKind` enum and `TLogEvent::MessageKind` field are removed;
  consumers dispatch via `std::holds_alternative`/`std::get` instead of a tag.
- Add the fluent `YT_TLOG_*` API: `YT_TLOG_INFO("Message").With(key, value)` and
  `.With(key, value, "%spec")`; disabled levels skip argument evaluation.
- Add well-known tags: `.With(value)` attaches a value under a statically known
  key resolved by ADL (e.g. `.With(error)` for the `Error` tag).
- Teach the plain-text and structured formatters to render tags; add the
  `enable_native_tags` knob to emit tags into a nested structured attribute.
- Add producer-side benchmarks. The tagged API is cheaper than `YT_LOG_*` for
  tagged calls and on par for tag-free ones:

#|
|| **Producer call** | **`YT_LOG_*`** | **`YT_TLOG_*`** | **Δ** ||
|| no tags   | 81 ns  | 82 ns  | +2%  ||
|| 1 tag     | 124 ns | 88 ns  | -29% ||
|| 2 tags    | 140 ns | 101 ns | -28% ||
|| 3 tags    | 372 ns | 283 ns | -24% ||
|#

--

#| || **&lt;a href="https://nda.ya.ru/t/p0sVNSOC7ijzFF" target="_blank"&gt;![](https://nda.ya.ru/t/mAiQIjHx7Mm3JC =30x) Echo tests&lt;/a&gt;** || |#
commit_hash:70efc90e5c2b71e5311415a4e4508db42ff28971
</content>
</entry>
<entry>
<title>Fix yt logging use-after-dtor</title>
<updated>2026-07-13T15:45:55Z</updated>
<author>
<name>makxenov</name>
<email>makxenov@yandex-team.com</email>
</author>
<published>2026-07-13T15:15:18Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=84c310b4a2da9282a84e318a7ed47a845686c3c3'/>
<id>urn:sha1:84c310b4a2da9282a84e318a7ed47a845686c3c3</id>
<content type='text'>
Similar to `CacheDestroyed` above in this file.

It is possible that `ThreadMessageTag` is read by the logger during thread shutdown after this thread-local's destruction (e.g. when another thread-local's destructor logs). Added a trivially destructible flag to guard the tag content.
commit_hash:852afe8245de23e9abe69a08bf5d9bfe4b17496b
</content>
</entry>
<entry>
<title>Fix use-after-free in TError during program shutdown</title>
<updated>2026-07-12T15:55:57Z</updated>
<author>
<name>perst20</name>
<email>59165467+perst20@users.noreply.github.com</email>
</author>
<published>2026-07-12T15:31:10Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=5b991b83e00ca047828c60502386ca835029bab3'/>
<id>urn:sha1:5b991b83e00ca047828c60502386ca835029bab3</id>
<content type='text'>
---

Type: fix
Component: library/cpp/yt/error

Problem: TError::Enricher_ and TError::FromExceptionEnricher_ are static class members whose destructors are registered when error.cpp is loaded. However, if any code calls Singleton&lt;&gt;() during static initialization before error.cpp loads, the OnExit handler gets registered in standard atexit() first. Due to LIFO ordering, at program exit the enrichers are destroyed before OnExit() runs, but OnExit() then destroys Singletons whose destructors may create TError objects (e.g., to cancel futures), which invokes Enrich() on the already-destroyed std::function, causing use-after-free. This can lead to intermittent segfaults depending on the link order of translation units.

Solution: Store enrichers in a LeakySingleton&lt;TEnricherStorage&gt; so they are never destroyed, as TError can be created anywhere including during program shutdown.

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1582
commit_hash:a9607f0094b4c60414d00ebca844db6a2ceafeb9
</content>
</entry>
<entry>
<title>YT-18571: Drop the redundant `#undef FOO_INL_H_` from `-inl.h` guard blocks.</title>
<updated>2026-07-12T15:32:51Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-07-12T15:08:14Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=7cf2e5a6f3716da406a37d3ef42431ec350cc9b6'/>
<id>urn:sha1:7cf2e5a6f3716da406a37d3ef42431ec350cc9b6</id>
<content type='text'>
commit_hash:8ccfa9ed373c83b84c21d12078e06befb05f026c
</content>
</entry>
<entry>
<title>Add bit I/O and binary interpolative coding to library/cpp/yt/coding</title>
<updated>2026-07-12T15:29:27Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-07-12T15:08:01Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=bedbabe6038ff3387ea48584da3e274e837551ff'/>
<id>urn:sha1:bedbabe6038ff3387ea48584da3e274e837551ff</id>
<content type='text'>
### `bit_io.h`
MSB-first bit-stream writer/reader (`TBitWriter` / `TBitReader`) over a caller-owned buffer. The writer flushes whole 32-bit words via the unaligned-store API; the reader assumes a few bytes of over-read slack.

### `interpolative.h`
- **Truncated-binary (minimal) code** — the entropy-optimal integer code for a uniform value in `[0, rangeSize)`.
- **Binary interpolative coding** — `InterpolativeEncode` / `InterpolativeDecode` for sorted, strictly increasing integer sequences over a known range `[lo, hi]`. It recursively codes the median of each subrange, compressing clustered sequences well below a flat `log2` per element with no per-element headers. Length is conveyed out of band (e.g. via the existing `varint`).
commit_hash:8baf84444b8cf8e8a6e32776b4ff48582187ac2b
</content>
</entry>
<entry>
<title>Avoid copy in TYsonString::ToSharedRef for TCowString payload</title>
<updated>2026-07-11T09:33:32Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-07-11T09:11:49Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=5ac6de48dc34290d9c66addb8b3094aa1b43e24b'/>
<id>urn:sha1:5ac6de48dc34290d9c66addb8b3094aa1b43e24b</id>
<content type='text'>
Use the payload itself as the shared range holder instead of copying the string via TSharedRef::FromString.
commit_hash:b427dbe6e8a8eaf3aa3c46b57f0f9965d57b3a95
</content>
</entry>
<entry>
<title>YT-18571: Drop TSharedRef::FromString(const char* str)</title>
<updated>2026-07-11T09:16:30Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-07-11T08:18:07Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=fa700ca3416d1c66def6cb16d5b85734e278406d'/>
<id>urn:sha1:fa700ca3416d1c66def6cb16d5b85734e278406d</id>
<content type='text'>
Rationale: all overloads of `TSharedRef::FromString` must remain cheap and don't copy any payload.

Remove the zero-terminated C string overload of `TSharedRef::FromString`.  Callers passing a string literal should use `std::string/TString` explicitly.

#| || **&lt;a href="https://nda.ya.ru/t/-VG7qyBv7iD8vm" target="_blank"&gt;![](https://nda.ya.ru/t/mAiQIjHx7Mm3JC =30x) Echo tests&lt;/a&gt;** || |#
commit_hash:1a6718abcbe4e6a8f58592f55de8c37ceb2b73d3
</content>
</entry>
<entry>
<title>Make the yt and flow sources buildable in the ytsaurus-cpp-sdk export</title>
<updated>2026-07-07T18:50:27Z</updated>
<author>
<name>mikari</name>
<email>mikari@yandex-team.com</email>
</author>
<published>2026-07-07T18:20:29Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=903560d682944ba9687cd4bdf323d0b627ac4fbd'/>
<id>urn:sha1:903560d682944ba9687cd4bdf323d0b627ac4fbd</id>
<content type='text'>
 Make the yt and flow sources buildable in the ytsaurus-cpp-sdk export
commit_hash:a733ad0d534a3717117cd80d162f6d527843decd
</content>
</entry>
</feed>
