{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/specifications/pulls/comments/238860919","pull_request_review_id":181505919,"id":238860919,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODg2MDkxOQ==","diff_hunk":"@@ -733,6 +733,19 @@ format:\n \n     { ok : 1, writeConcernError: {code: <Number>, errmsg : \"...\"} }\n \n+Mongos Pinning for Sharded Transactions\n+---------------------------------------\n+\n+The server supports sharded transactions starting in MongoDB 4.2 (\n+maxWireVersion 8). The server requires that drivers MUST send all commands for\n+a single transaction to the same mongos.\n+\n+After the driver selects a mongos for the first command within a transaction,\n+the driver MUST pin the ClientSession to the selected mongos. Drivers MUST\n+send all commands that are part of the same transaction, including\n+commitTransaction and abortTransaction and any retries thereof, to the\n+same mongos.","path":"source/transactions/transactions.rst","position":37,"original_position":37,"commit_id":"d575d30ac214d7efa5aca4c925a92ce3abab5cc4","original_commit_id":"d89b340d78ffadd187d6c01cf1ecf613804b4af9","user":{"login":"ShaneHarvey","id":5015933,"node_id":"MDQ6VXNlcjUwMTU5MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/5015933?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneHarvey","html_url":"https://github.com/ShaneHarvey","followers_url":"https://api.github.com/users/ShaneHarvey/followers","following_url":"https://api.github.com/users/ShaneHarvey/following{/other_user}","gists_url":"https://api.github.com/users/ShaneHarvey/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneHarvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneHarvey/subscriptions","organizations_url":"https://api.github.com/users/ShaneHarvey/orgs","repos_url":"https://api.github.com/users/ShaneHarvey/repos","events_url":"https://api.github.com/users/ShaneHarvey/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneHarvey/received_events","type":"User","site_admin":false},"body":"@EshaMaharishi recovery token will be added in https://jira.mongodb.org/browse/SPEC-1168.","created_at":"2018-12-04T22:16:11Z","updated_at":"2018-12-04T22:41:48Z","html_url":"https://github.com/mongodb/specifications/pull/416#discussion_r238860919","pull_request_url":"https://api.github.com/repos/mongodb/specifications/pulls/416","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/comments/238860919"},"html":{"href":"https://github.com/mongodb/specifications/pull/416#discussion_r238860919"},"pull_request":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/416"}},"in_reply_to_id":233307133},"pull_request":{"url":"https://api.github.com/repos/mongodb/specifications/pulls/416","id":230678348,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNjc4MzQ4","html_url":"https://github.com/mongodb/specifications/pull/416","diff_url":"https://github.com/mongodb/specifications/pull/416.diff","patch_url":"https://github.com/mongodb/specifications/pull/416.patch","issue_url":"https://api.github.com/repos/mongodb/specifications/issues/416","number":416,"state":"open","locked":false,"title":"SPEC-1140 Support mongos pinning for sharded transactions","user":{"login":"ShaneHarvey","id":5015933,"node_id":"MDQ6VXNlcjUwMTU5MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/5015933?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneHarvey","html_url":"https://github.com/ShaneHarvey","followers_url":"https://api.github.com/users/ShaneHarvey/followers","following_url":"https://api.github.com/users/ShaneHarvey/following{/other_user}","gists_url":"https://api.github.com/users/ShaneHarvey/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneHarvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneHarvey/subscriptions","organizations_url":"https://api.github.com/users/ShaneHarvey/orgs","repos_url":"https://api.github.com/users/ShaneHarvey/repos","events_url":"https://api.github.com/users/ShaneHarvey/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneHarvey/received_events","type":"User","site_admin":false},"body":"Jira: https://jira.mongodb.org/browse/SPEC-1140\r\n\r\nThis change adds the \"Mongos Pinning for Sharded Transactions\" section to the transactions spec and updates the tests for 4.2 sharded transactions.\r\n\r\nI have run the tests against a 4.1.5 sharded cluster with a single mongos. Tomorrow I'll have a patch build for the python driver POC running with two mongoses.\r\n\r\nSome open questions:\r\n- A buggy driver could still satisfy these spec tests by always selecting a single mongos for all operations on a session -- regardless if those operations are part of a transaction or not. Is it possible to test that drivers un-pinn a session properly? Eg:\r\n  ```python\r\n  with client.start_session() as s:\r\n    # All operations in this block use the same mongos.\r\n    with s.start_transaction():\r\n      client.test.test.insert_one({}, session=s) \r\n      client.test.test.find_one({}, session=s)\r\n    # Can we test that this next operation is not pinned to the previous mongos?\r\n    doc = client.test.test.find_one({}, session=s)\r\n  ```\r\n- Should we update the server selection spec to mention that sharded transactions do not go through the normal server selection process? Similar to cursors: https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#cursors\r\n- Should we specify what happens the pinned mongos becomes unavailable? Does any spec cover the same for cursors? ","created_at":"2018-11-14T01:10:04Z","updated_at":"2018-12-04T22:41:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9a0af5aae61ce2125ffb021047c61d63d1da410","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/specifications/pulls/416/commits","review_comments_url":"https://api.github.com/repos/mongodb/specifications/pulls/416/comments","review_comment_url":"https://api.github.com/repos/mongodb/specifications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/specifications/issues/416/comments","statuses_url":"https://api.github.com/repos/mongodb/specifications/statuses/d575d30ac214d7efa5aca4c925a92ce3abab5cc4","head":{"label":"ShaneHarvey:SPEC-1140","ref":"SPEC-1140","sha":"d575d30ac214d7efa5aca4c925a92ce3abab5cc4","user":{"login":"ShaneHarvey","id":5015933,"node_id":"MDQ6VXNlcjUwMTU5MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/5015933?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneHarvey","html_url":"https://github.com/ShaneHarvey","followers_url":"https://api.github.com/users/ShaneHarvey/followers","following_url":"https://api.github.com/users/ShaneHarvey/following{/other_user}","gists_url":"https://api.github.com/users/ShaneHarvey/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneHarvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneHarvey/subscriptions","organizations_url":"https://api.github.com/users/ShaneHarvey/orgs","repos_url":"https://api.github.com/users/ShaneHarvey/repos","events_url":"https://api.github.com/users/ShaneHarvey/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneHarvey/received_events","type":"User","site_admin":false},"repo":{"id":102051646,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIwNTE2NDY=","name":"specifications","full_name":"ShaneHarvey/specifications","private":false,"owner":{"login":"ShaneHarvey","id":5015933,"node_id":"MDQ6VXNlcjUwMTU5MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/5015933?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneHarvey","html_url":"https://github.com/ShaneHarvey","followers_url":"https://api.github.com/users/ShaneHarvey/followers","following_url":"https://api.github.com/users/ShaneHarvey/following{/other_user}","gists_url":"https://api.github.com/users/ShaneHarvey/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneHarvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneHarvey/subscriptions","organizations_url":"https://api.github.com/users/ShaneHarvey/orgs","repos_url":"https://api.github.com/users/ShaneHarvey/repos","events_url":"https://api.github.com/users/ShaneHarvey/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneHarvey/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ShaneHarvey/specifications","description":"Specifications related to MongoDB","fork":true,"url":"https://api.github.com/repos/ShaneHarvey/specifications","forks_url":"https://api.github.com/repos/ShaneHarvey/specifications/forks","keys_url":"https://api.github.com/repos/ShaneHarvey/specifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShaneHarvey/specifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShaneHarvey/specifications/teams","hooks_url":"https://api.github.com/repos/ShaneHarvey/specifications/hooks","issue_events_url":"https://api.github.com/repos/ShaneHarvey/specifications/issues/events{/number}","events_url":"https://api.github.com/repos/ShaneHarvey/specifications/events","assignees_url":"https://api.github.com/repos/ShaneHarvey/specifications/assignees{/user}","branches_url":"https://api.github.com/repos/ShaneHarvey/specifications/branches{/branch}","tags_url":"https://api.github.com/repos/ShaneHarvey/specifications/tags","blobs_url":"https://api.github.com/repos/ShaneHarvey/specifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShaneHarvey/specifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShaneHarvey/specifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShaneHarvey/specifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShaneHarvey/specifications/statuses/{sha}","languages_url":"https://api.github.com/repos/ShaneHarvey/specifications/languages","stargazers_url":"https://api.github.com/repos/ShaneHarvey/specifications/stargazers","contributors_url":"https://api.github.com/repos/ShaneHarvey/specifications/contributors","subscribers_url":"https://api.github.com/repos/ShaneHarvey/specifications/subscribers","subscription_url":"https://api.github.com/repos/ShaneHarvey/specifications/subscription","commits_url":"https://api.github.com/repos/ShaneHarvey/specifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShaneHarvey/specifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShaneHarvey/specifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShaneHarvey/specifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShaneHarvey/specifications/contents/{+path}","compare_url":"https://api.github.com/repos/ShaneHarvey/specifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShaneHarvey/specifications/merges","archive_url":"https://api.github.com/repos/ShaneHarvey/specifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShaneHarvey/specifications/downloads","issues_url":"https://api.github.com/repos/ShaneHarvey/specifications/issues{/number}","pulls_url":"https://api.github.com/repos/ShaneHarvey/specifications/pulls{/number}","milestones_url":"https://api.github.com/repos/ShaneHarvey/specifications/milestones{/number}","notifications_url":"https://api.github.com/repos/ShaneHarvey/specifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShaneHarvey/specifications/labels{/name}","releases_url":"https://api.github.com/repos/ShaneHarvey/specifications/releases{/id}","deployments_url":"https://api.github.com/repos/ShaneHarvey/specifications/deployments","created_at":"2017-08-31T22:42:34Z","updated_at":"2018-12-03T23:48:30Z","pushed_at":"2018-12-04T22:41:45Z","git_url":"git://github.com/ShaneHarvey/specifications.git","ssh_url":"git@github.com:ShaneHarvey/specifications.git","clone_url":"https://github.com/ShaneHarvey/specifications.git","svn_url":"https://github.com/ShaneHarvey/specifications","homepage":null,"size":4013,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mongodb:master","ref":"master","sha":"e52c829b2f185d184512883b5e9468960f0031a3","user":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":19244865,"node_id":"MDEwOlJlcG9zaXRvcnkxOTI0NDg2NQ==","name":"specifications","full_name":"mongodb/specifications","private":false,"owner":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mongodb/specifications","description":"Specifications related to MongoDB","fork":false,"url":"https://api.github.com/repos/mongodb/specifications","forks_url":"https://api.github.com/repos/mongodb/specifications/forks","keys_url":"https://api.github.com/repos/mongodb/specifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/specifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/specifications/teams","hooks_url":"https://api.github.com/repos/mongodb/specifications/hooks","issue_events_url":"https://api.github.com/repos/mongodb/specifications/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/specifications/events","assignees_url":"https://api.github.com/repos/mongodb/specifications/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/specifications/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/specifications/tags","blobs_url":"https://api.github.com/repos/mongodb/specifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/specifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/specifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/specifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/specifications/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/specifications/languages","stargazers_url":"https://api.github.com/repos/mongodb/specifications/stargazers","contributors_url":"https://api.github.com/repos/mongodb/specifications/contributors","subscribers_url":"https://api.github.com/repos/mongodb/specifications/subscribers","subscription_url":"https://api.github.com/repos/mongodb/specifications/subscription","commits_url":"https://api.github.com/repos/mongodb/specifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/specifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/specifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/specifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/specifications/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/specifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/specifications/merges","archive_url":"https://api.github.com/repos/mongodb/specifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/specifications/downloads","issues_url":"https://api.github.com/repos/mongodb/specifications/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/specifications/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/specifications/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/specifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/specifications/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/specifications/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/specifications/deployments","created_at":"2014-04-28T16:04:56Z","updated_at":"2018-12-04T18:38:51Z","pushed_at":"2018-12-04T22:41:47Z","git_url":"git://github.com/mongodb/specifications.git","ssh_url":"git@github.com:mongodb/specifications.git","clone_url":"https://github.com/mongodb/specifications.git","svn_url":"https://github.com/mongodb/specifications","homepage":null,"size":3986,"stargazers_count":129,"watchers_count":129,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":79,"open_issues":10,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/416"},"html":{"href":"https://github.com/mongodb/specifications/pull/416"},"issue":{"href":"https://api.github.com/repos/mongodb/specifications/issues/416"},"comments":{"href":"https://api.github.com/repos/mongodb/specifications/issues/416/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/416/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/specifications/pulls/416/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/specifications/statuses/d575d30ac214d7efa5aca4c925a92ce3abab5cc4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ShaneHarvey"}}