{"action":"opened","number":4309,"pull_request":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309","id":36506030,"html_url":"https://github.com/rethinkdb/rethinkdb/pull/4309","diff_url":"https://github.com/rethinkdb/rethinkdb/pull/4309.diff","patch_url":"https://github.com/rethinkdb/rethinkdb/pull/4309.patch","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4309","number":4309,"state":"open","locked":false,"title":"Add SmartOS support","user":{"login":"jperkin","id":128042,"avatar_url":"https://avatars.githubusercontent.com/u/128042?v=3","gravatar_id":"","url":"https://api.github.com/users/jperkin","html_url":"https://github.com/jperkin","followers_url":"https://api.github.com/users/jperkin/followers","following_url":"https://api.github.com/users/jperkin/following{/other_user}","gists_url":"https://api.github.com/users/jperkin/gists{/gist_id}","starred_url":"https://api.github.com/users/jperkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperkin/subscriptions","organizations_url":"https://api.github.com/users/jperkin/orgs","repos_url":"https://api.github.com/users/jperkin/repos","events_url":"https://api.github.com/users/jperkin/events{/privacy}","received_events_url":"https://api.github.com/users/jperkin/received_events","type":"User","site_admin":false},"body":"This is a set of commits that add support for SmartOS.\r\n\r\n* 63bcfc2 changes `file_t` to `myfile_t`, `file_t` is exposed from `sys/file.h` on SmartOS.\r\n* 7c4d34a changes `lock_t` to `mylock_t`, `lock_t` is exposed from `sys/machtypes.h` on SmartOS.\r\n* 5702f34 is a set of general portability fixes, required on SmartOS but should be generally applicable and help other ports.\r\n* e826138 adds the core of the SmartOS support, notably an event ports backend for the event queue and timers.\r\n* f257229 isn't great, hence marked XXX, but is currently required as std::to_string isn't available even in C++11 mode with GCC 4.7 on SmartOS.  Looking around this seems to be a problem with other operating systems too.  Ideas for handling this better would be welcome.\r\n\r\nWith these changes applied I am able to run a server in both 32-bit and 64-bit builds.  It should be broadly compatible with other illumos distributions and Oracle Solaris, but those have not been verified.\r\n\r\nRunning the unittest suite on 32-bit results in:\r\n\r\n```\r\n[==========] 287 tests from 63 test cases ran. (779139 ms total)\r\n[  PASSED  ] 285 tests.\r\n[  FAILED  ] 2 tests, listed below:\r\n[  FAILED  ] UtilsTest.IPAddress\r\n[  FAILED  ] RDBBtree.SindexEraseRange\r\n```\r\n\r\nThe `RDBBtree.SindexEraseRange` failure looks very similar to #3805:\r\n\r\n```\r\n[ RUN      ] RDBBtree.SindexEraseRange\r\nsrc/unittest/rdb_btree.cc:253: Failure\r\nValue of: groups->size()\r\n  Actual: 0\r\nExpected: 1\r\nsrc/unittest/rdb_btree.cc:253: Failure\r\nValue of: groups->size()\r\n  Actual: 0\r\nExpected: 1\r\n[  FAILED  ] RDBBtree.SindexEraseRange (11438 ms)\r\n```\r\n\r\nThe `UtilsTest.IPAddress` failure is:\r\n\r\n```\r\n[ RUN      ] UtilsTest.IPAddress\r\nsrc/unittest/utils_test.cc:134: Failure\r\nValue of: ip_strings.find(\"::ffff:203.0.113.59\") != ip_strings.end()\r\n  Actual: false\r\nExpected: true\r\n[  FAILED  ] UtilsTest.IPAddress (2 ms)\r\n```\r\n\r\nFor this test `ip_strings` only contains `203.0.113.59`, so it may just need a change to handle the `getaddrinfo()` handling on SmartOS.\r\n\r\nWhen running the test suite against the 64-bit build, I see intermittent failures in the Clustering tests with heartbeat timeouts, but haven't tracked those down yet, otherwise same results as the 32-bit build.  Running the standalone server seems to work fine.\r\n\r\nI have no real interest in retaining copyright and signing the CLA, so you can consider these changes as being in the public domain and are welcome to take them as your own.","created_at":"2015-05-29T13:40:36Z","updated_at":"2015-05-29T13:40:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed9f1dad16c4caefb1c7f721c016ecf3c14a554d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309/commits","review_comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309/comments","review_comment_url":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4309/comments","statuses_url":"https://api.github.com/repos/rethinkdb/rethinkdb/statuses/f2572294ac71de1c316657f09822573f21b9937d","head":{"label":"jperkin:next","ref":"next","sha":"f2572294ac71de1c316657f09822573f21b9937d","user":{"login":"jperkin","id":128042,"avatar_url":"https://avatars.githubusercontent.com/u/128042?v=3","gravatar_id":"","url":"https://api.github.com/users/jperkin","html_url":"https://github.com/jperkin","followers_url":"https://api.github.com/users/jperkin/followers","following_url":"https://api.github.com/users/jperkin/following{/other_user}","gists_url":"https://api.github.com/users/jperkin/gists{/gist_id}","starred_url":"https://api.github.com/users/jperkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperkin/subscriptions","organizations_url":"https://api.github.com/users/jperkin/orgs","repos_url":"https://api.github.com/users/jperkin/repos","events_url":"https://api.github.com/users/jperkin/events{/privacy}","received_events_url":"https://api.github.com/users/jperkin/received_events","type":"User","site_admin":false},"repo":{"id":36429286,"name":"rethinkdb","full_name":"jperkin/rethinkdb","owner":{"login":"jperkin","id":128042,"avatar_url":"https://avatars.githubusercontent.com/u/128042?v=3","gravatar_id":"","url":"https://api.github.com/users/jperkin","html_url":"https://github.com/jperkin","followers_url":"https://api.github.com/users/jperkin/followers","following_url":"https://api.github.com/users/jperkin/following{/other_user}","gists_url":"https://api.github.com/users/jperkin/gists{/gist_id}","starred_url":"https://api.github.com/users/jperkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperkin/subscriptions","organizations_url":"https://api.github.com/users/jperkin/orgs","repos_url":"https://api.github.com/users/jperkin/repos","events_url":"https://api.github.com/users/jperkin/events{/privacy}","received_events_url":"https://api.github.com/users/jperkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jperkin/rethinkdb","description":"An open-source distributed JSON document database with a pleasant and powerful query language.","fork":true,"url":"https://api.github.com/repos/jperkin/rethinkdb","forks_url":"https://api.github.com/repos/jperkin/rethinkdb/forks","keys_url":"https://api.github.com/repos/jperkin/rethinkdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jperkin/rethinkdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jperkin/rethinkdb/teams","hooks_url":"https://api.github.com/repos/jperkin/rethinkdb/hooks","issue_events_url":"https://api.github.com/repos/jperkin/rethinkdb/issues/events{/number}","events_url":"https://api.github.com/repos/jperkin/rethinkdb/events","assignees_url":"https://api.github.com/repos/jperkin/rethinkdb/assignees{/user}","branches_url":"https://api.github.com/repos/jperkin/rethinkdb/branches{/branch}","tags_url":"https://api.github.com/repos/jperkin/rethinkdb/tags","blobs_url":"https://api.github.com/repos/jperkin/rethinkdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jperkin/rethinkdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jperkin/rethinkdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/jperkin/rethinkdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jperkin/rethinkdb/statuses/{sha}","languages_url":"https://api.github.com/repos/jperkin/rethinkdb/languages","stargazers_url":"https://api.github.com/repos/jperkin/rethinkdb/stargazers","contributors_url":"https://api.github.com/repos/jperkin/rethinkdb/contributors","subscribers_url":"https://api.github.com/repos/jperkin/rethinkdb/subscribers","subscription_url":"https://api.github.com/repos/jperkin/rethinkdb/subscription","commits_url":"https://api.github.com/repos/jperkin/rethinkdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/jperkin/rethinkdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/jperkin/rethinkdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/jperkin/rethinkdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/jperkin/rethinkdb/contents/{+path}","compare_url":"https://api.github.com/repos/jperkin/rethinkdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jperkin/rethinkdb/merges","archive_url":"https://api.github.com/repos/jperkin/rethinkdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jperkin/rethinkdb/downloads","issues_url":"https://api.github.com/repos/jperkin/rethinkdb/issues{/number}","pulls_url":"https://api.github.com/repos/jperkin/rethinkdb/pulls{/number}","milestones_url":"https://api.github.com/repos/jperkin/rethinkdb/milestones{/number}","notifications_url":"https://api.github.com/repos/jperkin/rethinkdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jperkin/rethinkdb/labels{/name}","releases_url":"https://api.github.com/repos/jperkin/rethinkdb/releases{/id}","created_at":"2015-05-28T09:48:51Z","updated_at":"2015-05-28T09:48:59Z","pushed_at":"2015-05-29T12:39:54Z","git_url":"git://github.com/jperkin/rethinkdb.git","ssh_url":"git@github.com:jperkin/rethinkdb.git","clone_url":"https://github.com/jperkin/rethinkdb.git","svn_url":"https://github.com/jperkin/rethinkdb","homepage":"http://www.rethinkdb.com","size":457979,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"rethinkdb:next","ref":"next","sha":"5b3079e1487fc64727c307ced8127d55cf6c269d","user":{"login":"rethinkdb","id":1229647,"avatar_url":"https://avatars.githubusercontent.com/u/1229647?v=3","gravatar_id":"","url":"https://api.github.com/users/rethinkdb","html_url":"https://github.com/rethinkdb","followers_url":"https://api.github.com/users/rethinkdb/followers","following_url":"https://api.github.com/users/rethinkdb/following{/other_user}","gists_url":"https://api.github.com/users/rethinkdb/gists{/gist_id}","starred_url":"https://api.github.com/users/rethinkdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rethinkdb/subscriptions","organizations_url":"https://api.github.com/users/rethinkdb/orgs","repos_url":"https://api.github.com/users/rethinkdb/repos","events_url":"https://api.github.com/users/rethinkdb/events{/privacy}","received_events_url":"https://api.github.com/users/rethinkdb/received_events","type":"Organization","site_admin":false},"repo":{"id":6452529,"name":"rethinkdb","full_name":"rethinkdb/rethinkdb","owner":{"login":"rethinkdb","id":1229647,"avatar_url":"https://avatars.githubusercontent.com/u/1229647?v=3","gravatar_id":"","url":"https://api.github.com/users/rethinkdb","html_url":"https://github.com/rethinkdb","followers_url":"https://api.github.com/users/rethinkdb/followers","following_url":"https://api.github.com/users/rethinkdb/following{/other_user}","gists_url":"https://api.github.com/users/rethinkdb/gists{/gist_id}","starred_url":"https://api.github.com/users/rethinkdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rethinkdb/subscriptions","organizations_url":"https://api.github.com/users/rethinkdb/orgs","repos_url":"https://api.github.com/users/rethinkdb/repos","events_url":"https://api.github.com/users/rethinkdb/events{/privacy}","received_events_url":"https://api.github.com/users/rethinkdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rethinkdb/rethinkdb","description":"An open-source distributed JSON document database with a pleasant and powerful query language.","fork":false,"url":"https://api.github.com/repos/rethinkdb/rethinkdb","forks_url":"https://api.github.com/repos/rethinkdb/rethinkdb/forks","keys_url":"https://api.github.com/repos/rethinkdb/rethinkdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rethinkdb/rethinkdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rethinkdb/rethinkdb/teams","hooks_url":"https://api.github.com/repos/rethinkdb/rethinkdb/hooks","issue_events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/events{/number}","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/events","assignees_url":"https://api.github.com/repos/rethinkdb/rethinkdb/assignees{/user}","branches_url":"https://api.github.com/repos/rethinkdb/rethinkdb/branches{/branch}","tags_url":"https://api.github.com/repos/rethinkdb/rethinkdb/tags","blobs_url":"https://api.github.com/repos/rethinkdb/rethinkdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rethinkdb/rethinkdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rethinkdb/rethinkdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/rethinkdb/rethinkdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rethinkdb/rethinkdb/statuses/{sha}","languages_url":"https://api.github.com/repos/rethinkdb/rethinkdb/languages","stargazers_url":"https://api.github.com/repos/rethinkdb/rethinkdb/stargazers","contributors_url":"https://api.github.com/repos/rethinkdb/rethinkdb/contributors","subscribers_url":"https://api.github.com/repos/rethinkdb/rethinkdb/subscribers","subscription_url":"https://api.github.com/repos/rethinkdb/rethinkdb/subscription","commits_url":"https://api.github.com/repos/rethinkdb/rethinkdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/rethinkdb/rethinkdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/rethinkdb/rethinkdb/contents/{+path}","compare_url":"https://api.github.com/repos/rethinkdb/rethinkdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rethinkdb/rethinkdb/merges","archive_url":"https://api.github.com/repos/rethinkdb/rethinkdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rethinkdb/rethinkdb/downloads","issues_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues{/number}","pulls_url":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls{/number}","milestones_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones{/number}","notifications_url":"https://api.github.com/repos/rethinkdb/rethinkdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels{/name}","releases_url":"https://api.github.com/repos/rethinkdb/rethinkdb/releases{/id}","created_at":"2012-10-30T05:37:47Z","updated_at":"2015-05-29T07:24:03Z","pushed_at":"2015-05-29T13:40:36Z","git_url":"git://github.com/rethinkdb/rethinkdb.git","ssh_url":"git@github.com:rethinkdb/rethinkdb.git","clone_url":"https://github.com/rethinkdb/rethinkdb.git","svn_url":"https://github.com/rethinkdb/rethinkdb","homepage":"http://www.rethinkdb.com","size":457979,"stargazers_count":9060,"watchers_count":9060,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":769,"mirror_url":null,"open_issues_count":1011,"forks":769,"open_issues":1011,"watchers":9060,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309"},"html":{"href":"https://github.com/rethinkdb/rethinkdb/pull/4309"},"issue":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4309"},"comments":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4309/comments"},"review_comments":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309/comments"},"review_comment":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/pulls/4309/commits"},"statuses":{"href":"https://api.github.com/repos/rethinkdb/rethinkdb/statuses/f2572294ac71de1c316657f09822573f21b9937d"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":5,"additions":575,"deletions":155,"changed_files":73}}