[DOCS-10839] Docs for SERVER-31011: Provide transaction table hook for session expiration Created: 27/Sep/17  Updated: 29/Oct/23  Resolved: 29/Nov/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.14, 3.6.0-rc0

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-31011 Provide transaction table hook for se... Closed
Related
related to DOCS-10736 Docs for SERVER-28918: Make CRUD writ... Closed
Participants:
Days since reply: 6 years, 11 weeks ago
Epic Link: DOCS: 3.6 Server

 Description   

Documentation Request Summary:

This adds a new set parameter called TransactionRecordMinimumLifetimeMinutes

I've dropped the comment that explains it in the code below

constexpr Minutes kTransactionRecordMinimumLifetime(30);

/**

  • The minimum lifetime for a transaction record is how long it has to have lived on the server
  • before we'll consider it for cleanup. This is effectively the window for how long it is
  • permissible for a mongos to hang before we're willing to accept a failure of the retryable write
  • subsystem.
    *
  • Specifically, we imagine that a client connects to one mongos on a session and performs a
  • retryable write. That mongos hangs. Then the client connects to a new mongos on the same
  • session and successfully executes its write. After a day passes, the session will time out,
  • cleaning up the retryable write. Then the original mongos wakes up, vivifies the session and
  • executes the write (because all records of the session + transaction have been deleted).
    *
  • So the write is performed twice, which is unavoidable without losing session vivification and/or
  • requiring synchronized clocks all the way out to the client. In lieu of that we provide a weaker
  • guarantee after the minimum transaction lifetime.
    */
    MONGO_EXPORT_STARTUP_SERVER_PARAMETER(TransactionRecordMinimumLifetimeMinutes,
    int,
    kTransactionRecordMinimumLifetime.count());

Engineering Ticket Description:

We need to provide a hook for transaction expiration which is invoked on all standalones and primaries to alert the retryable write subsystem when sessions have expired.

The lifetime and logic here seems identical to the rules for cursors (The cursor manager tells us what sessions are used by cursors, then we tell the cursor manager to drop the cursors attached to those sessions). We can replace the first step with a scan of the transaction table and the second with invocation of a callback that retryable writes can fill in (either via a callback injection or having them implement a service liason method).



 Comments   
Comment by Githook User [ 29/Nov/17 ]

Author:

{'name': 'kay', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10839: TransactionRecordMinimumLifetimeMinutes parameter for mongod
Branch: master
https://github.com/mongodb/docs/commit/5d559f1394434fad65ca34aafb6dad808d3fa34f

Generated at Thu Feb 08 08:01:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.