{"action":"created","comment":{"url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/comments/312764589","pull_request_review_id":273490949,"id":312764589,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMjc2NDU4OQ==","diff_hunk":"@@ -367,11 +367,20 @@ static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* instance, MXS_SESSION* session\n                     candidate = ref;\n                 }\n             }\n-            else if ((ref->connections + 1) / ref->server_weight\n-                     < (candidate->connections + 1) / candidate->server_weight)\n+            else\n             {\n-                /* ref has a better score. */\n-                candidate = ref;\n+                uint64_t score1 = (ref->connections + 1) / ref->server_weight;\n+                uint64_t score2 = (candidate->connections + 1) / candidate->server_weight;\n+                if (score1 < score2)\n+                {\n+                    /* ref has a better score. */\n+                    candidate = ref;\n+                }\n+                else if (score1 == score2 && ref->lru_clock < candidate->lru_clock)","path":"server/modules/routing/readconnroute/readconnroute.cc","position":null,"original_position":17,"commit_id":"3805c2c52a0e8100e7a658a4690bb240ae1f6e71","original_commit_id":"aab67eb1c438084fefb0feeeb9c34d1333ce8246","user":{"login":"ybbct","id":1227070,"node_id":"MDQ6VXNlcjEyMjcwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1227070?v=4","gravatar_id":"","url":"https://api.github.com/users/ybbct","html_url":"https://github.com/ybbct","followers_url":"https://api.github.com/users/ybbct/followers","following_url":"https://api.github.com/users/ybbct/following{/other_user}","gists_url":"https://api.github.com/users/ybbct/gists{/gist_id}","starred_url":"https://api.github.com/users/ybbct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybbct/subscriptions","organizations_url":"https://api.github.com/users/ybbct/orgs","repos_url":"https://api.github.com/users/ybbct/repos","events_url":"https://api.github.com/users/ybbct/events{/privacy}","received_events_url":"https://api.github.com/users/ybbct/received_events","type":"User","site_admin":false},"body":"No, most of our instances are 2.2, few are 2.3, no 2.4","created_at":"2019-08-12T01:20:32Z","updated_at":"2019-08-12T01:20:33Z","html_url":"https://github.com/mariadb-corporation/MaxScale/pull/198#discussion_r312764589","pull_request_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/comments/312764589"},"html":{"href":"https://github.com/mariadb-corporation/MaxScale/pull/198#discussion_r312764589"},"pull_request":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198"}},"in_reply_to_id":312334646},"pull_request":{"url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198","id":305831142,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA1ODMxMTQy","html_url":"https://github.com/mariadb-corporation/MaxScale/pull/198","diff_url":"https://github.com/mariadb-corporation/MaxScale/pull/198.diff","patch_url":"https://github.com/mariadb-corporation/MaxScale/pull/198.patch","issue_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/198","number":198,"state":"open","locked":false,"title":"MXS-2628: load balance use lru when score is same","user":{"login":"ybbct","id":1227070,"node_id":"MDQ6VXNlcjEyMjcwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1227070?v=4","gravatar_id":"","url":"https://api.github.com/users/ybbct","html_url":"https://github.com/ybbct","followers_url":"https://api.github.com/users/ybbct/followers","following_url":"https://api.github.com/users/ybbct/following{/other_user}","gists_url":"https://api.github.com/users/ybbct/gists{/gist_id}","starred_url":"https://api.github.com/users/ybbct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybbct/subscriptions","organizations_url":"https://api.github.com/users/ybbct/orgs","repos_url":"https://api.github.com/users/ybbct/repos","events_url":"https://api.github.com/users/ybbct/events{/privacy}","received_events_url":"https://api.github.com/users/ybbct/received_events","type":"User","site_admin":false},"body":"I am contributing the new code of the whole pull request, including one or\r\nseveral files that are either new files or modified ones, under the BSD-new\r\nlicense.\r\n","created_at":"2019-08-09T04:30:39Z","updated_at":"2019-08-12T01:20:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbb31730476f1dd029b9ed84f1238e06e7d6b72a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198/commits","review_comments_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198/comments","review_comment_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/198/comments","statuses_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/statuses/3805c2c52a0e8100e7a658a4690bb240ae1f6e71","head":{"label":"ybbct:mxs-2628","ref":"mxs-2628","sha":"3805c2c52a0e8100e7a658a4690bb240ae1f6e71","user":{"login":"ybbct","id":1227070,"node_id":"MDQ6VXNlcjEyMjcwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1227070?v=4","gravatar_id":"","url":"https://api.github.com/users/ybbct","html_url":"https://github.com/ybbct","followers_url":"https://api.github.com/users/ybbct/followers","following_url":"https://api.github.com/users/ybbct/following{/other_user}","gists_url":"https://api.github.com/users/ybbct/gists{/gist_id}","starred_url":"https://api.github.com/users/ybbct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybbct/subscriptions","organizations_url":"https://api.github.com/users/ybbct/orgs","repos_url":"https://api.github.com/users/ybbct/repos","events_url":"https://api.github.com/users/ybbct/events{/privacy}","received_events_url":"https://api.github.com/users/ybbct/received_events","type":"User","site_admin":false},"repo":{"id":120287635,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAyODc2MzU=","name":"MaxScale","full_name":"ybbct/MaxScale","private":false,"owner":{"login":"ybbct","id":1227070,"node_id":"MDQ6VXNlcjEyMjcwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1227070?v=4","gravatar_id":"","url":"https://api.github.com/users/ybbct","html_url":"https://github.com/ybbct","followers_url":"https://api.github.com/users/ybbct/followers","following_url":"https://api.github.com/users/ybbct/following{/other_user}","gists_url":"https://api.github.com/users/ybbct/gists{/gist_id}","starred_url":"https://api.github.com/users/ybbct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybbct/subscriptions","organizations_url":"https://api.github.com/users/ybbct/orgs","repos_url":"https://api.github.com/users/ybbct/repos","events_url":"https://api.github.com/users/ybbct/events{/privacy}","received_events_url":"https://api.github.com/users/ybbct/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ybbct/MaxScale","description":"An intelligent database proxy.","fork":true,"url":"https://api.github.com/repos/ybbct/MaxScale","forks_url":"https://api.github.com/repos/ybbct/MaxScale/forks","keys_url":"https://api.github.com/repos/ybbct/MaxScale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ybbct/MaxScale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ybbct/MaxScale/teams","hooks_url":"https://api.github.com/repos/ybbct/MaxScale/hooks","issue_events_url":"https://api.github.com/repos/ybbct/MaxScale/issues/events{/number}","events_url":"https://api.github.com/repos/ybbct/MaxScale/events","assignees_url":"https://api.github.com/repos/ybbct/MaxScale/assignees{/user}","branches_url":"https://api.github.com/repos/ybbct/MaxScale/branches{/branch}","tags_url":"https://api.github.com/repos/ybbct/MaxScale/tags","blobs_url":"https://api.github.com/repos/ybbct/MaxScale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ybbct/MaxScale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ybbct/MaxScale/git/refs{/sha}","trees_url":"https://api.github.com/repos/ybbct/MaxScale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ybbct/MaxScale/statuses/{sha}","languages_url":"https://api.github.com/repos/ybbct/MaxScale/languages","stargazers_url":"https://api.github.com/repos/ybbct/MaxScale/stargazers","contributors_url":"https://api.github.com/repos/ybbct/MaxScale/contributors","subscribers_url":"https://api.github.com/repos/ybbct/MaxScale/subscribers","subscription_url":"https://api.github.com/repos/ybbct/MaxScale/subscription","commits_url":"https://api.github.com/repos/ybbct/MaxScale/commits{/sha}","git_commits_url":"https://api.github.com/repos/ybbct/MaxScale/git/commits{/sha}","comments_url":"https://api.github.com/repos/ybbct/MaxScale/comments{/number}","issue_comment_url":"https://api.github.com/repos/ybbct/MaxScale/issues/comments{/number}","contents_url":"https://api.github.com/repos/ybbct/MaxScale/contents/{+path}","compare_url":"https://api.github.com/repos/ybbct/MaxScale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ybbct/MaxScale/merges","archive_url":"https://api.github.com/repos/ybbct/MaxScale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ybbct/MaxScale/downloads","issues_url":"https://api.github.com/repos/ybbct/MaxScale/issues{/number}","pulls_url":"https://api.github.com/repos/ybbct/MaxScale/pulls{/number}","milestones_url":"https://api.github.com/repos/ybbct/MaxScale/milestones{/number}","notifications_url":"https://api.github.com/repos/ybbct/MaxScale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ybbct/MaxScale/labels{/name}","releases_url":"https://api.github.com/repos/ybbct/MaxScale/releases{/id}","deployments_url":"https://api.github.com/repos/ybbct/MaxScale/deployments","created_at":"2018-02-05T10:08:18Z","updated_at":"2018-02-05T10:08:26Z","pushed_at":"2019-08-09T09:21:47Z","git_url":"git://github.com/ybbct/MaxScale.git","ssh_url":"git@github.com:ybbct/MaxScale.git","clone_url":"https://github.com/ybbct/MaxScale.git","svn_url":"https://github.com/ybbct/MaxScale","homepage":"https://github.com/mariadb-corporation/MaxScale/wiki","size":99351,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":"2.2"}},"base":{"label":"mariadb-corporation:2.3","ref":"2.3","sha":"eda830c9f3cc52f9d0216da686a0d81565caedf6","user":{"login":"mariadb-corporation","id":5877084,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU4NzcwODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5877084?v=4","gravatar_id":"","url":"https://api.github.com/users/mariadb-corporation","html_url":"https://github.com/mariadb-corporation","followers_url":"https://api.github.com/users/mariadb-corporation/followers","following_url":"https://api.github.com/users/mariadb-corporation/following{/other_user}","gists_url":"https://api.github.com/users/mariadb-corporation/gists{/gist_id}","starred_url":"https://api.github.com/users/mariadb-corporation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariadb-corporation/subscriptions","organizations_url":"https://api.github.com/users/mariadb-corporation/orgs","repos_url":"https://api.github.com/users/mariadb-corporation/repos","events_url":"https://api.github.com/users/mariadb-corporation/events{/privacy}","received_events_url":"https://api.github.com/users/mariadb-corporation/received_events","type":"Organization","site_admin":false},"repo":{"id":15231881,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMTg4MQ==","name":"MaxScale","full_name":"mariadb-corporation/MaxScale","private":false,"owner":{"login":"mariadb-corporation","id":5877084,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU4NzcwODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5877084?v=4","gravatar_id":"","url":"https://api.github.com/users/mariadb-corporation","html_url":"https://github.com/mariadb-corporation","followers_url":"https://api.github.com/users/mariadb-corporation/followers","following_url":"https://api.github.com/users/mariadb-corporation/following{/other_user}","gists_url":"https://api.github.com/users/mariadb-corporation/gists{/gist_id}","starred_url":"https://api.github.com/users/mariadb-corporation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariadb-corporation/subscriptions","organizations_url":"https://api.github.com/users/mariadb-corporation/orgs","repos_url":"https://api.github.com/users/mariadb-corporation/repos","events_url":"https://api.github.com/users/mariadb-corporation/events{/privacy}","received_events_url":"https://api.github.com/users/mariadb-corporation/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mariadb-corporation/MaxScale","description":"An intelligent database proxy.","fork":false,"url":"https://api.github.com/repos/mariadb-corporation/MaxScale","forks_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/forks","keys_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/teams","hooks_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/hooks","issue_events_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/events{/number}","events_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/events","assignees_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/assignees{/user}","branches_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/branches{/branch}","tags_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/tags","blobs_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/git/refs{/sha}","trees_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/statuses/{sha}","languages_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/languages","stargazers_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/stargazers","contributors_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/contributors","subscribers_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/subscribers","subscription_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/subscription","commits_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/commits{/sha}","git_commits_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/git/commits{/sha}","comments_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/comments{/number}","issue_comment_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/comments{/number}","contents_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/contents/{+path}","compare_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/merges","archive_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/downloads","issues_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues{/number}","pulls_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls{/number}","milestones_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/milestones{/number}","notifications_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/labels{/name}","releases_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/releases{/id}","deployments_url":"https://api.github.com/repos/mariadb-corporation/MaxScale/deployments","created_at":"2013-12-16T17:09:46Z","updated_at":"2019-08-10T19:29:02Z","pushed_at":"2019-08-10T02:07:04Z","git_url":"git://github.com/mariadb-corporation/MaxScale.git","ssh_url":"git@github.com:mariadb-corporation/MaxScale.git","clone_url":"https://github.com/mariadb-corporation/MaxScale.git","svn_url":"https://github.com/mariadb-corporation/MaxScale","homepage":"https://github.com/mariadb-corporation/MaxScale/wiki","size":106268,"stargazers_count":943,"watchers_count":943,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":255,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":255,"open_issues":1,"watchers":943,"default_branch":"2.3"}},"_links":{"self":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198"},"html":{"href":"https://github.com/mariadb-corporation/MaxScale/pull/198"},"issue":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/198"},"comments":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/mariadb-corporation/MaxScale/statuses/3805c2c52a0e8100e7a658a4690bb240ae1f6e71"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ybbct"}}