Skip to content

v3.138.0

Choose a tag to compare

@ydb-platform-bot ydb-platform-bot released this 21 May 18:05
· 52 commits to master since this release
  • Reworked the internal table/query session pool (#2137, #2163):
    • semaphore-based concurrency limit instead of an internal wait queue and index map;
    • synchronous session creation in the caller goroutine (no background create goroutine per session slot);
    • pool statistics are updated less frequently after finishing internal.Pool.With call to reduce CPU overhead
  • Session pool behavior:
    • FIFO semantics replaced with LIFO semantics (read about LIFO advantages in article)
    • when the pool limit is reached, session pool blocks on a semaphore until a slot is released, instead of registering on an internal wait queue
    • errPoolIsOverflow is no longer returned from the pool. Client can receive only context errors if context is done and pool cannot get session for work
    • trace.Table.OnPoolWait callbacks are no longer invoked (the hook remains in the trace API but is unused by the pool)
    • default create/close timeout has been reduced to 500 msec in order to achieve a faster failure, thus leading to earlier retry and successful call, rather than the default multi-second delay on a cold start or under overload conditions.
  • Added WithSessionPoolWarmUpSessions driver option: at driver initialization, pre-creates up to N sessions in the table client pool and the query explicit session pool (N > 0; N <= 0 disables warm-up; default is no warm-up). The configured N is stored in pool stats as WarmUp; the number of sessions actually created is min(N, pool limit). Driver initialization fails if warm-up session creation fails
  • Trace/metrics (breaking for custom handlers):
    • Added to trace.{TablePoolStateChangeInfo,QueryPoolChange} field Concurrency
    • Marked as deprecated fields Index and Wait in trace.{TablePoolStateChangeInfo,QueryPoolChange}

Full Changelog: v3.137.0...v3.138.0