{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/influxdb/pulls/comments/80958327","pull_request_review_id":1974534,"id":80958327,"diff_hunk":"@@ -360,6 +360,77 @@ func TestMetaClient_SetDefaultRetentionPolicy(t *testing.T) {\n \t}\n }\n \n+func TestMetaClient_UpdateRetentionPolicy(t *testing.T) {\n+\tt.Parallel()\n+\n+\td, c := newClient()\n+\tdefer os.RemoveAll(d)\n+\tdefer c.Close()\n+\n+\tif _, err := c.CreateDatabaseWithRetentionPolicy(\"db0\", &meta.RetentionPolicySpec{\n+\t\tName:               \"rp0\",\n+\t\tShardGroupDuration: 4 * time.Hour,\n+\t}); err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\n+\trpi, err := c.RetentionPolicy(\"db0\", \"rp0\")\n+\tif err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\n+\t// Set the duration to another value and ensure that the shard group duration\n+\t// doesn't change.\n+\tduration := 2 * rpi.ShardGroupDuration\n+\treplicaN := 1\n+\tif err := c.UpdateRetentionPolicy(\"db0\", \"rp0\", &meta.RetentionPolicyUpdate{\n+\t\tDuration: &duration,\n+\t\tReplicaN: &replicaN,\n+\t}); err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\n+\trpi, err = c.RetentionPolicy(\"db0\", \"rp0\")\n+\tif err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\tif exp, got := 4*time.Hour, rpi.ShardGroupDuration; exp != got {\n+\t\tt.Fatalf(\"shard group duration wrong: \\n\\texp: %s\\n\\tgot: %s\", exp, got)\n+\t}\n+\n+\t// Set the duration to below the shard group duration. This should return an error.\n+\tduration = rpi.ShardGroupDuration / 2\n+\tif err := c.UpdateRetentionPolicy(\"db0\", \"rp0\", &meta.RetentionPolicyUpdate{\n+\t\tDuration: &duration,\n+\t}); err == nil {\n+\t\tt.Fatal(\"expected error\")\n+\t} else if err != meta.ErrRetentionPolicyDurationBelowShardDuration {\n+\t\tt.Fatalf(\"expected error '%s', got '%s'\", meta.ErrRetentionPolicyDurationBelowShardDuration, err)\n+\t}\n+\n+\t// Set the shard duration above the shard group duration. This should also return an error.","path":"services/meta/client_test.go","position":null,"original_position":52,"commit_id":"ffa10464a6b9aa30d6b1d76362d103972d1a7d0c","original_commit_id":"f8c3dcd94e1452b8fa3f0ef3017605b318508133","user":{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false},"body":"Whoops. It seems I messed up changing the second half of this comment. Fixed.","created_at":"2016-09-28T16:21:59Z","updated_at":"2016-09-28T16:21:59Z","html_url":"https://github.com/influxdata/influxdb/pull/7372#discussion_r80958327","pull_request_url":"https://api.github.com/repos/influxdata/influxdb/pulls/7372","_links":{"self":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/comments/80958327"},"html":{"href":"https://github.com/influxdata/influxdb/pull/7372#discussion_r80958327"},"pull_request":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/7372"}}},"pull_request":{"url":"https://api.github.com/repos/influxdata/influxdb/pulls/7372","id":87000089,"html_url":"https://github.com/influxdata/influxdb/pull/7372","diff_url":"https://github.com/influxdata/influxdb/pull/7372.diff","patch_url":"https://github.com/influxdata/influxdb/pull/7372.patch","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/7372","number":7372,"state":"open","locked":false,"title":"Do not automatically reset the shard duration when using ALTER RETENTION POLICY","user":{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false},"body":"Fixes #7150.","created_at":"2016-09-27T19:56:19Z","updated_at":"2016-09-28T16:21:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"767930918e9aec7d89399d2ab7acd40c01e4af0b","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/influxdata/influxdb/milestones/59","html_url":"https://github.com/influxdata/influxdb/milestones/1.0.2","labels_url":"https://api.github.com/repos/influxdata/influxdb/milestones/59/labels","id":2029433,"number":59,"title":"1.0.2","description":"","creator":{"login":"jwilder","id":219935,"avatar_url":"https://avatars.githubusercontent.com/u/219935?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilder","html_url":"https://github.com/jwilder","followers_url":"https://api.github.com/users/jwilder/followers","following_url":"https://api.github.com/users/jwilder/following{/other_user}","gists_url":"https://api.github.com/users/jwilder/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilder/subscriptions","organizations_url":"https://api.github.com/users/jwilder/orgs","repos_url":"https://api.github.com/users/jwilder/repos","events_url":"https://api.github.com/users/jwilder/events{/privacy}","received_events_url":"https://api.github.com/users/jwilder/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2016-09-26T17:03:57Z","updated_at":"2016-09-27T20:03:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/influxdata/influxdb/pulls/7372/commits","review_comments_url":"https://api.github.com/repos/influxdata/influxdb/pulls/7372/comments","review_comment_url":"https://api.github.com/repos/influxdata/influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/7372/comments","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/ffa10464a6b9aa30d6b1d76362d103972d1a7d0c","head":{"label":"influxdata:js-7150-alter-retention-policy-resets-sg-duration","ref":"js-7150-alter-retention-policy-resets-sg-duration","sha":"ffa10464a6b9aa30d6b1d76362d103972d1a7d0c","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdata/influxdb","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdata/influxdb","forks_url":"https://api.github.com/repos/influxdata/influxdb/forks","keys_url":"https://api.github.com/repos/influxdata/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdata/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdata/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/influxdb/events","assignees_url":"https://api.github.com/repos/influxdata/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdata/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdata/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdata/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdata/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdata/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdata/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/influxdb/merges","archive_url":"https://api.github.com/repos/influxdata/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdata/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/influxdb/deployments","created_at":"2013-09-26T14:31:10Z","updated_at":"2016-09-28T14:05:17Z","pushed_at":"2016-09-28T16:21:45Z","git_url":"git://github.com/influxdata/influxdb.git","ssh_url":"git@github.com:influxdata/influxdb.git","clone_url":"https://github.com/influxdata/influxdb.git","svn_url":"https://github.com/influxdata/influxdb","homepage":"https://influxdata.com","size":61766,"stargazers_count":8963,"watchers_count":8963,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1249,"mirror_url":null,"open_issues_count":418,"forks":1249,"open_issues":418,"watchers":8963,"default_branch":"master"}},"base":{"label":"influxdata:1.0","ref":"1.0","sha":"6660bf5cbaff0372e44e5c1145ed65a08777dbe9","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdata/influxdb","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdata/influxdb","forks_url":"https://api.github.com/repos/influxdata/influxdb/forks","keys_url":"https://api.github.com/repos/influxdata/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdata/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdata/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/influxdb/events","assignees_url":"https://api.github.com/repos/influxdata/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdata/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdata/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdata/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdata/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdata/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdata/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/influxdb/merges","archive_url":"https://api.github.com/repos/influxdata/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdata/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/influxdb/deployments","created_at":"2013-09-26T14:31:10Z","updated_at":"2016-09-28T14:05:17Z","pushed_at":"2016-09-28T16:21:45Z","git_url":"git://github.com/influxdata/influxdb.git","ssh_url":"git@github.com:influxdata/influxdb.git","clone_url":"https://github.com/influxdata/influxdb.git","svn_url":"https://github.com/influxdata/influxdb","homepage":"https://influxdata.com","size":61766,"stargazers_count":8963,"watchers_count":8963,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1249,"mirror_url":null,"open_issues_count":418,"forks":1249,"open_issues":418,"watchers":8963,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/7372"},"html":{"href":"https://github.com/influxdata/influxdb/pull/7372"},"issue":{"href":"https://api.github.com/repos/influxdata/influxdb/issues/7372"},"comments":{"href":"https://api.github.com/repos/influxdata/influxdb/issues/7372/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/7372/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/7372/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/influxdb/statuses/ffa10464a6b9aa30d6b1d76362d103972d1a7d0c"}}}}
{"actor":{"display_login":"jsternberg"}}