[GODRIVER-52] Implement Drivers Sessions API Created: 01/Aug/17  Updated: 28/Oct/23  Resolved: 24/Jul/18

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 0.0.10

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on GODRIVER-254 Redesign the private package Closed
depends on GODRIVER-463 Design: Sessions API Closed
is depended on by DRIVERS-395 Implement Drivers Sessions API Closed
is depended on by GODRIVER-53 Retryable writes Closed
is depended on by GODRIVER-56 Causally Consistent Reads support Closed
Duplicate
is duplicated by GODRIVER-255 Prohibit using unacknowledged writes ... Closed
is duplicated by GODRIVER-233 Decrease likelihood of implicit sessi... Closed
Related
related to GODRIVER-482 Separate command.Command into command... Closed
Epic Link: GODRIVER MongoDB 3.6 Server Support

 Comments   
Comment by Githook User [ 24/Jul/18 ]

Author:

{'username': 'rfblue2', 'name': 'Roland Fong', 'email': 'rfblue2@gmail.com'}

Message: Remove Drop option from collectionopt

GODRIVER-52

Change-Id: If6b6f70c2e40742ff7fa185f91e254e2d71f1517
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/eecffe0eec1ec89b01fcb17f288d59dfde0ab9e8

Comment by Githook User [ 24/Jul/18 ]

Author:

{'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}

Message: Sessions test plan.

GODRIVER-52

Change-Id: I6a8bd4ffa33d478bf6df2974e963a6339622f3c0
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/aa6b7a8459262327a39d8862903910164b5bf43f

Comment by Githook User [ 24/Jul/18 ]

Author:

{'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}

Message: Add Session Client Methods

GODRIVER-52

Change-Id: I4db2bbee2cb5105482c0a5d2182bd909af51c857
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/e18bcf0a07ef7b845320f49126c97e8fede5e7a9

Comment by Githook User [ 24/Jul/18 ]

Author:

{'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}

Message: Add Mongo Session passable as an option

GODRIVER-52

Change-Id: I7e93694aea2d8407036b24e019f01ae59ef2e716
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/bf02b960a7cc35f6a07da8ddfab978eb0eaaed6e

Comment by Githook User [ 24/Jul/18 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: Implement sessions in core

GODRIVER-52

Change-Id: Ib3d60f531955a866f9b2c3fb58c5d12caff5681f
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/3d8db415387ae8e8035c706eb1217ed3743f2980

Comment by David Golden [ 09/Mar/18 ]

Waiting on GODRIVER-254

Comment by David Golden [ 21/Jan/18 ]

eliot suggests giving users session objects that satisfy the context.Context interface. That would allow users to pass them as the first argument to functions that take context as the first argument, which conveniently is what the Driver Sessions spec wants as well.

I have some additional thoughts to consider before we implement.

We have to think about composability of contexts. If a user has an existing context, we may want client.StartSession to have a WithContext(ctx) option to wrap an existing context instead of defaulting to context.Background().

Likewise, if a client has a session object satisfying context.Context and then wants to wrap it in some other context afterwards (e.g. a timeout), we need to let them do that in a way that doesn't prevent them from calling Session API methods. E.g. a user calling context.WithTimeout(session, time.Duration(2)*time.Second) winds up with a type that no longer allows calling session API methods.

We could store a session as a context value (using context.WithValue()) and require users to explicitly extract it to call methods. This composes cleanly with other contexts, but is less elegant to read and may have some performance overhead to retrieve session values. Providing some sugar functions in a session package would make it much nicer to read/use. E.g.

ctx.Value(mongo.SessionContextKey).EndSession() // long-hand
 
session.End(ctx) // sugar that does the above

That requires a sugar function taking a context object in the session package for every ClientSession API method described in the Drivers Sessions Spec.

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