[GODRIVER-3027] Fix and improve causal consistency Go driver examples Created: 31/Oct/23  Updated: 06/Nov/23

Status: Backlog
Project: Go Driver
Component/s: Causal Consistency, Docs Examples
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Matt Dale Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-2915 hasEnded() Method on Session Closed

 Description   

The "Causal Consistency Example 2" in examples.go (see here) seems to not work correctly. Specifically, the example creates session2 and sets operation and cluster time on that session, but then calls UseSessionWithOptions and uses that SessionContext to actually run the operations. There seems to be no relationship between those sessions, so it seems like the example doesn't actually use a causally consistent session and would be misleading to anyone who reads it. Additionally, it's not clear if that example in examples.go is actually used in any documentation. It would be much more useful if it was part of a testable example.

Definition of done:

  • Correct the causal consistency example(s) in examples.go.
  • Test that the causal consistency example(s) actually create causal consistency within and between sessions.
  • Add a causal consistency testable example to the Session documentation.

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