From 530b00bd769f00e328400eab8c1b065a46884af5 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Tue, 9 Aug 2016 12:00:04 -0500 Subject: [PATCH] Use defaults from `meta` package for `CREATE DATABASE` Instead of having the parser set the defaults, the command will set the defaults so that the constants for that are actually used. This way we can also identify which things the user provided and which ones we are filling with default values. This allows the meta client to be able to make smarter decisions when determining if the user requested a conflict or if the requested capabilities match with what is currently available. If you just say `CREATE DATABASE WITH NAME myrp`, the user doesn't really care what the duration of the retention policy is and just wants to use the default. Now, we can use that information to determine if an existing retention policy would conflict with what the user requested rather than returning an error if a default value ever gets changed since the meta client command can communicate intent more easily. --- CHANGELOG.md | 1 + cmd/influxd/run/backup_restore_test.go | 2 +- cmd/influxd/run/server_helpers_test.go | 10 +- cmd/influxd/run/server_test.go | 88 +++---- coordinator/meta_client.go | 4 +- coordinator/meta_client_test.go | 13 +- coordinator/statement_executor.go | 27 ++- influxql/ast.go | 23 +- influxql/parser.go | 14 +- influxql/parser_test.go | 32 +-- monitor/service.go | 15 +- services/graphite/service.go | 12 +- services/graphite/service_test.go | 4 +- services/meta/client.go | 67 ++--- services/meta/client_test.go | 94 +++++-- services/meta/data.go | 140 +++++++++-- services/meta/errors.go | 4 + services/meta/internal/meta.pb.go | 323 ++++++++++++++----------- services/meta/internal/meta.proto | 7 + 19 files changed, 552 insertions(+), 328 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49e44452222..68855fa5e3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,7 @@ With this release the systemd configuration files for InfluxDB will use the syst - [#7025](https://github.com/influxdata/influxdb/issues/7025): Move the CQ interval by the group by offset. - [#7125](https://github.com/influxdata/influxdb/pull/7125): Ensure gzip writer is closed in influx_inspect export - [#7127](https://github.com/influxdata/influxdb/pull/7127): Concurrent series limit +- [#7119](https://github.com/influxdata/influxdb/pull/7119): Fix CREATE DATABASE when dealing with default values. ## v0.13.0 [2016-05-12] diff --git a/cmd/influxd/run/backup_restore_test.go b/cmd/influxd/run/backup_restore_test.go index dfe82416b5a..2175677742e 100644 --- a/cmd/influxd/run/backup_restore_test.go +++ b/cmd/influxd/run/backup_restore_test.go @@ -34,7 +34,7 @@ func TestServer_BackupAndRestore(t *testing.T) { s := OpenServer(config) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy(db, newRetentionPolicyInfo(rp, 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(db, newRetentionPolicySpec(rp, 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(db, rp); err != nil { diff --git a/cmd/influxd/run/server_helpers_test.go b/cmd/influxd/run/server_helpers_test.go index 64a655f4e5a..bd1ca62f249 100644 --- a/cmd/influxd/run/server_helpers_test.go +++ b/cmd/influxd/run/server_helpers_test.go @@ -78,7 +78,7 @@ func OpenServerWithVersion(c *run.Config, version string) *Server { // OpenDefaultServer opens a test server with a default database & retention policy. func OpenDefaultServer(c *run.Config) *Server { s := OpenServer(c) - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { panic(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -111,7 +111,7 @@ func (s *Server) URL() string { } // CreateDatabaseAndRetentionPolicy will create the database and retention policy. -func (s *Server) CreateDatabaseAndRetentionPolicy(db string, rp *meta.RetentionPolicyInfo) error { +func (s *Server) CreateDatabaseAndRetentionPolicy(db string, rp *meta.RetentionPolicySpec) error { if _, err := s.MetaClient.CreateDatabase(db); err != nil { return err } else if _, err := s.MetaClient.CreateRetentionPolicy(db, rp); err != nil { @@ -250,8 +250,8 @@ func NewConfig() *run.Config { return c } -func newRetentionPolicyInfo(name string, rf int, duration time.Duration) *meta.RetentionPolicyInfo { - return &meta.RetentionPolicyInfo{Name: name, ReplicaN: rf, Duration: duration} +func newRetentionPolicySpec(name string, rf int, duration time.Duration) *meta.RetentionPolicySpec { + return &meta.RetentionPolicySpec{Name: name, ReplicaN: &rf, Duration: &duration} } func maxFloat64() string { @@ -456,7 +456,7 @@ func writeTestData(s *Server, t *Test) error { w.rp = t.retentionPolicy() } - if err := s.CreateDatabaseAndRetentionPolicy(w.db, newRetentionPolicyInfo(w.rp, 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(w.db, newRetentionPolicySpec(w.rp, 1, 0)); err != nil { return err } if err := s.MetaClient.SetDefaultRetentionPolicy(w.db, w.rp); err != nil { diff --git a/cmd/influxd/run/server_test.go b/cmd/influxd/run/server_test.go index dc13725eff3..8c6c7382786 100644 --- a/cmd/influxd/run/server_test.go +++ b/cmd/influxd/run/server_test.go @@ -54,7 +54,7 @@ func TestServer_Query_DropAndRecreateDatabase(t *testing.T) { test := tests.load(t, "drop_and_recreate_database") - if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicyInfo(test.retentionPolicy(), 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicySpec(test.retentionPolicy(), 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(test.database(), test.retentionPolicy()); err != nil { @@ -86,13 +86,13 @@ func TestServer_Query_DropDatabaseIsolated(t *testing.T) { test := tests.load(t, "drop_database_isolated") - if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicyInfo(test.retentionPolicy(), 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicySpec(test.retentionPolicy(), 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(test.database(), test.retentionPolicy()); err != nil { t.Fatal(err) } - if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicyInfo("rp1", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicySpec("rp1", 1, 0)); err != nil { t.Fatal(err) } @@ -121,7 +121,7 @@ func TestServer_Query_DeleteSeries(t *testing.T) { test := tests.load(t, "delete_series") - if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicyInfo(test.retentionPolicy(), 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicySpec(test.retentionPolicy(), 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(test.database(), test.retentionPolicy()); err != nil { @@ -153,7 +153,7 @@ func TestServer_Query_DropAndRecreateSeries(t *testing.T) { test := tests.load(t, "drop_and_recreate_series") - if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicyInfo(test.retentionPolicy(), 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicySpec(test.retentionPolicy(), 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(test.database(), test.retentionPolicy()); err != nil { @@ -205,7 +205,7 @@ func TestServer_Query_DropSeriesFromRegex(t *testing.T) { test := tests.load(t, "drop_series_from_regex") - if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicyInfo(test.retentionPolicy(), 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy(test.database(), newRetentionPolicySpec(test.retentionPolicy(), 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy(test.database(), test.retentionPolicy()); err != nil { @@ -379,7 +379,7 @@ func TestServer_Write_LineProtocol_Float(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 1*time.Hour)); err != nil { t.Fatal(err) } @@ -404,7 +404,7 @@ func TestServer_Write_LineProtocol_Bool(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 1*time.Hour)); err != nil { t.Fatal(err) } @@ -429,7 +429,7 @@ func TestServer_Write_LineProtocol_String(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 1*time.Hour)); err != nil { t.Fatal(err) } @@ -454,7 +454,7 @@ func TestServer_Write_LineProtocol_Integer(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 1*time.Hour)); err != nil { t.Fatal(err) } @@ -480,7 +480,7 @@ func TestServer_Write_LineProtocol_Partial(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 1*time.Hour)); err != nil { t.Fatal(err) } @@ -2405,7 +2405,7 @@ func TestServer_Query_MergeMany(t *testing.T) { defer s.Close() // set infinite retention policy as we are inserting data in the past and don't want retention policy enforcement to make this test racy - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } @@ -2465,7 +2465,7 @@ func TestServer_Query_SLimitAndSOffset(t *testing.T) { defer s.Close() // set infinite retention policy as we are inserting data in the past and don't want retention policy enforcement to make this test racy - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } @@ -2521,7 +2521,7 @@ func TestServer_Query_Regex(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -3476,7 +3476,7 @@ func TestServer_Query_AggregateSelectors(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -3772,7 +3772,7 @@ func TestServer_Query_TopInt(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -3939,7 +3939,7 @@ func TestServer_Query_Aggregates_IdenticalTime(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4007,7 +4007,7 @@ func TestServer_Query_GroupByTimeCutoffs(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4089,7 +4089,7 @@ func TestServer_Write_Precision(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4206,7 +4206,7 @@ func TestServer_Query_Wildcards(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4324,7 +4324,7 @@ func TestServer_Query_WildcardExpansion(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4404,7 +4404,7 @@ func TestServer_Query_AcrossShardsAndFields(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4478,7 +4478,7 @@ func TestServer_Query_Where_Fields(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4700,7 +4700,7 @@ func TestServer_Query_Where_With_Tags(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4788,7 +4788,7 @@ func TestServer_Query_With_EmptyTags(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4879,7 +4879,7 @@ func TestServer_Query_LimitAndOffset(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -4996,7 +4996,7 @@ func TestServer_Query_Fill(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5095,7 +5095,7 @@ func TestServer_Query_Chunk(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5147,13 +5147,13 @@ func TestServer_Query_DropAndRecreateMeasurement(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { t.Fatal(err) } - if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db1", "rp0"); err != nil { @@ -5313,7 +5313,7 @@ func TestServer_Query_ShowQueries_Future(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5385,7 +5385,7 @@ func TestServer_Query_ShowSeries(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5487,7 +5487,7 @@ func TestServer_Query_ShowMeasurements(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5577,7 +5577,7 @@ func TestServer_Query_ShowTagKeys(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5727,7 +5727,7 @@ func TestServer_Query_ShowFieldKeys(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5793,7 +5793,7 @@ func TestServer_ContinuousQuery(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -5928,7 +5928,7 @@ func TestServer_ContinuousQuery_Deadlock(t *testing.T) { s.Server = nil }() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6001,7 +6001,7 @@ func TestServer_Query_EvilIdentifiers(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6045,7 +6045,7 @@ func TestServer_Query_OrderByTime(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6107,7 +6107,7 @@ func TestServer_Query_FieldWithMultiplePeriods(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6161,7 +6161,7 @@ func TestServer_Query_FieldWithMultiplePeriodsMeasurementPrefixMatch(t *testing. s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6215,7 +6215,7 @@ func TestServer_Query_IntoTarget(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { @@ -6275,7 +6275,7 @@ func TestServer_Query_DuplicateMeasurements(t *testing.T) { defer s.Close() // Create a second database. - if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db1", "rp0"); err != nil { @@ -6402,7 +6402,7 @@ func TestServer_WhereTimeInclusive(t *testing.T) { s := OpenServer(NewConfig()) defer s.Close() - if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil { + if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicySpec("rp0", 1, 0)); err != nil { t.Fatal(err) } if err := s.MetaClient.SetDefaultRetentionPolicy("db0", "rp0"); err != nil { diff --git a/coordinator/meta_client.go b/coordinator/meta_client.go index 64ae32c2259..b7b3136085e 100644 --- a/coordinator/meta_client.go +++ b/coordinator/meta_client.go @@ -11,8 +11,8 @@ import ( type MetaClient interface { CreateContinuousQuery(database, name, query string) error CreateDatabase(name string) (*meta.DatabaseInfo, error) - CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) - CreateRetentionPolicy(database string, rpi *meta.RetentionPolicyInfo) (*meta.RetentionPolicyInfo, error) + CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) + CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) CreateSubscription(database, rp, name, mode string, destinations []string) error CreateUser(name, password string, admin bool) (*meta.UserInfo, error) Database(name string) *meta.DatabaseInfo diff --git a/coordinator/meta_client_test.go b/coordinator/meta_client_test.go index 92ce941845d..88dfd7b0600 100644 --- a/coordinator/meta_client_test.go +++ b/coordinator/meta_client_test.go @@ -11,8 +11,8 @@ import ( type MetaClient struct { CreateContinuousQueryFn func(database, name, query string) error CreateDatabaseFn func(name string) (*meta.DatabaseInfo, error) - CreateDatabaseWithRetentionPolicyFn func(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) - CreateRetentionPolicyFn func(database string, rpi *meta.RetentionPolicyInfo) (*meta.RetentionPolicyInfo, error) + CreateDatabaseWithRetentionPolicyFn func(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) + CreateRetentionPolicyFn func(database string, spec *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) CreateSubscriptionFn func(database, rp, name, mode string, destinations []string) error CreateUserFn func(name, password string, admin bool) (*meta.UserInfo, error) DatabaseFn func(name string) *meta.DatabaseInfo @@ -48,13 +48,14 @@ func (c *MetaClient) CreateDatabase(name string) (*meta.DatabaseInfo, error) { return c.CreateDatabaseFn(name) } -func (c *MetaClient) CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) { - return c.CreateDatabaseWithRetentionPolicyFn(name, rpi) +func (c *MetaClient) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) { + return c.CreateDatabaseWithRetentionPolicyFn(name, spec) } -func (c *MetaClient) CreateRetentionPolicy(database string, rpi *meta.RetentionPolicyInfo) (*meta.RetentionPolicyInfo, error) { - return c.CreateRetentionPolicyFn(database, rpi) +func (c *MetaClient) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) { + return c.CreateRetentionPolicyFn(database, spec) } + func (c *MetaClient) DropShard(id uint64) error { return c.DropShardFn(id) } diff --git a/coordinator/statement_executor.go b/coordinator/statement_executor.go index 49f4bcbcd94..c0040c6a9a0 100644 --- a/coordinator/statement_executor.go +++ b/coordinator/statement_executor.go @@ -252,28 +252,33 @@ func (e *StatementExecutor) executeCreateDatabaseStatement(stmt *influxql.Create return err } - rpi := meta.NewRetentionPolicyInfo(stmt.RetentionPolicyName) - rpi.Duration = stmt.RetentionPolicyDuration - rpi.ReplicaN = stmt.RetentionPolicyReplication - rpi.ShardGroupDuration = stmt.RetentionPolicyShardGroupDuration - _, err := e.MetaClient.CreateDatabaseWithRetentionPolicy(stmt.Name, rpi) + spec := meta.RetentionPolicySpec{ + Name: stmt.RetentionPolicyName, + Duration: stmt.RetentionPolicyDuration, + ReplicaN: stmt.RetentionPolicyReplication, + ShardGroupDuration: stmt.RetentionPolicyShardGroupDuration, + } + _, err := e.MetaClient.CreateDatabaseWithRetentionPolicy(stmt.Name, &spec) return err } func (e *StatementExecutor) executeCreateRetentionPolicyStatement(stmt *influxql.CreateRetentionPolicyStatement) error { - rpi := meta.NewRetentionPolicyInfo(stmt.Name) - rpi.Duration = stmt.Duration - rpi.ReplicaN = stmt.Replication - rpi.ShardGroupDuration = stmt.ShardGroupDuration + spec := meta.RetentionPolicySpec{ + Name: stmt.Name, + Duration: &stmt.Duration, + ReplicaN: &stmt.Replication, + ShardGroupDuration: stmt.ShardGroupDuration, + } // Create new retention policy. - if _, err := e.MetaClient.CreateRetentionPolicy(stmt.Database, rpi); err != nil { + rp, err := e.MetaClient.CreateRetentionPolicy(stmt.Database, &spec) + if err != nil { return err } // If requested, set new policy as the default. if stmt.Default { - if err := e.MetaClient.SetDefaultRetentionPolicy(stmt.Database, stmt.Name); err != nil { + if err := e.MetaClient.SetDefaultRetentionPolicy(stmt.Database, rp.Name); err != nil { return err } } diff --git a/influxql/ast.go b/influxql/ast.go index 06e211b8d6e..790c645eb66 100644 --- a/influxql/ast.go +++ b/influxql/ast.go @@ -463,10 +463,10 @@ type CreateDatabaseStatement struct { RetentionPolicyCreate bool // RetentionPolicyDuration indicates retention duration for the new database - RetentionPolicyDuration time.Duration + RetentionPolicyDuration *time.Duration // RetentionPolicyReplication indicates retention replication for the new database - RetentionPolicyReplication int + RetentionPolicyReplication *int // RetentionPolicyName indicates retention name for the new database RetentionPolicyName string @@ -481,16 +481,23 @@ func (s *CreateDatabaseStatement) String() string { _, _ = buf.WriteString("CREATE DATABASE ") _, _ = buf.WriteString(QuoteIdent(s.Name)) if s.RetentionPolicyCreate { - _, _ = buf.WriteString(" WITH DURATION ") - _, _ = buf.WriteString(s.RetentionPolicyDuration.String()) - _, _ = buf.WriteString(" REPLICATION ") - _, _ = buf.WriteString(strconv.Itoa(s.RetentionPolicyReplication)) + _, _ = buf.WriteString(" WITH") + if s.RetentionPolicyDuration != nil { + _, _ = buf.WriteString(" DURATION ") + _, _ = buf.WriteString(s.RetentionPolicyDuration.String()) + } + if s.RetentionPolicyReplication != nil { + _, _ = buf.WriteString(" REPLICATION ") + _, _ = buf.WriteString(strconv.Itoa(*s.RetentionPolicyReplication)) + } if s.RetentionPolicyShardGroupDuration > 0 { _, _ = buf.WriteString(" SHARD DURATION ") _, _ = buf.WriteString(s.RetentionPolicyShardGroupDuration.String()) } - _, _ = buf.WriteString(" NAME ") - _, _ = buf.WriteString(QuoteIdent(s.RetentionPolicyName)) + if s.RetentionPolicyName != "" { + _, _ = buf.WriteString(" NAME ") + _, _ = buf.WriteString(QuoteIdent(s.RetentionPolicyName)) + } } return buf.String() diff --git a/influxql/parser.go b/influxql/parser.go index c732441e90c..c5383740143 100644 --- a/influxql/parser.go +++ b/influxql/parser.go @@ -1541,31 +1541,28 @@ func (p *Parser) parseCreateDatabaseStatement() (*CreateDatabaseStatement, error stmt.RetentionPolicyCreate = true // Look for "DURATION" - var rpDuration time.Duration // default is forever if err := p.parseTokens([]Token{DURATION}); err != nil { p.unscan() } else { - rpDuration, err = p.parseDuration() + rpDuration, err := p.parseDuration() if err != nil { return nil, err } + stmt.RetentionPolicyDuration = &rpDuration } - stmt.RetentionPolicyDuration = rpDuration // Look for "REPLICATION" - var rpReplication = 1 // default is 1 if err := p.parseTokens([]Token{REPLICATION}); err != nil { p.unscan() } else { - rpReplication, err = p.parseInt(1, math.MaxInt32) + rpReplication, err := p.parseInt(1, math.MaxInt32) if err != nil { return nil, err } + stmt.RetentionPolicyReplication = &rpReplication } - stmt.RetentionPolicyReplication = rpReplication // Look for "SHARD" - var rpShardGroupDuration time.Duration if err := p.parseTokens([]Token{SHARD}); err != nil { p.unscan() } else { @@ -1574,11 +1571,10 @@ func (p *Parser) parseCreateDatabaseStatement() (*CreateDatabaseStatement, error if tok != DURATION { return nil, newParseError(tokstr(tok, lit), []string{"DURATION"}, pos) } - rpShardGroupDuration, err = p.parseDuration() + stmt.RetentionPolicyShardGroupDuration, err = p.parseDuration() if err != nil { return nil, err } - stmt.RetentionPolicyShardGroupDuration = rpShardGroupDuration } // Look for "NAME" diff --git a/influxql/parser_test.go b/influxql/parser_test.go index b514cb57f7f..76ec18368a7 100644 --- a/influxql/parser_test.go +++ b/influxql/parser_test.go @@ -1635,9 +1635,8 @@ func TestParser_ParseStatement(t *testing.T) { s: `CREATE DATABASE testdb WITH DURATION 24h`, stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", - RetentionPolicyCreate: true, - RetentionPolicyDuration: 24 * time.Hour, - RetentionPolicyReplication: 1, + RetentionPolicyCreate: true, + RetentionPolicyDuration: duration(24 * time.Hour), }, }, { @@ -1645,8 +1644,6 @@ func TestParser_ParseStatement(t *testing.T) { stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", RetentionPolicyCreate: true, - RetentionPolicyDuration: 0, - RetentionPolicyReplication: 1, RetentionPolicyShardGroupDuration: 30 * time.Minute, }, }, @@ -1655,18 +1652,15 @@ func TestParser_ParseStatement(t *testing.T) { stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", RetentionPolicyCreate: true, - RetentionPolicyDuration: 0, - RetentionPolicyReplication: 2, + RetentionPolicyReplication: intptr(2), }, }, { s: `CREATE DATABASE testdb WITH NAME test_name`, stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", - RetentionPolicyCreate: true, - RetentionPolicyDuration: 0, - RetentionPolicyReplication: 1, - RetentionPolicyName: "test_name", + RetentionPolicyCreate: true, + RetentionPolicyName: "test_name", }, }, { @@ -1674,8 +1668,8 @@ func TestParser_ParseStatement(t *testing.T) { stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", RetentionPolicyCreate: true, - RetentionPolicyDuration: 24 * time.Hour, - RetentionPolicyReplication: 2, + RetentionPolicyDuration: duration(24 * time.Hour), + RetentionPolicyReplication: intptr(2), RetentionPolicyName: "test_name", }, }, @@ -1684,8 +1678,8 @@ func TestParser_ParseStatement(t *testing.T) { stmt: &influxql.CreateDatabaseStatement{ Name: "testdb", RetentionPolicyCreate: true, - RetentionPolicyDuration: 24 * time.Hour, - RetentionPolicyReplication: 2, + RetentionPolicyDuration: duration(24 * time.Hour), + RetentionPolicyReplication: intptr(2), RetentionPolicyName: "test_name", RetentionPolicyShardGroupDuration: 10 * time.Minute, }, @@ -2812,3 +2806,11 @@ func mustParseDuration(s string) time.Duration { } return d } + +func duration(v time.Duration) *time.Duration { + return &v +} + +func intptr(v int) *int { + return &v +} diff --git a/monitor/service.go b/monitor/service.go index 6ce6ce7702a..75fab168654 100644 --- a/monitor/service.go +++ b/monitor/service.go @@ -23,6 +23,7 @@ import ( const ( MonitorRetentionPolicy = "monitor" MonitorRetentionPolicyDuration = 7 * 24 * time.Hour + MonitorRetentionPolicyReplicaN = 1 ) // Monitor represents an instance of the monitor system. @@ -51,7 +52,7 @@ type Monitor struct { storeInterval time.Duration MetaClient interface { - CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) + CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) Database(name string) *meta.DatabaseInfo } @@ -352,11 +353,15 @@ func (m *Monitor) createInternalStorage() { } if di := m.MetaClient.Database(m.storeDatabase); di == nil { - rpi := meta.NewRetentionPolicyInfo(MonitorRetentionPolicy) - rpi.Duration = MonitorRetentionPolicyDuration - rpi.ReplicaN = 1 + duration := MonitorRetentionPolicyDuration + replicaN := MonitorRetentionPolicyReplicaN + spec := meta.RetentionPolicySpec{ + Name: MonitorRetentionPolicy, + Duration: &duration, + ReplicaN: &replicaN, + } - if _, err := m.MetaClient.CreateDatabaseWithRetentionPolicy(m.storeDatabase, rpi); err != nil { + if _, err := m.MetaClient.CreateDatabaseWithRetentionPolicy(m.storeDatabase, &spec); err != nil { m.Logger.Printf("failed to create database '%s', failed to create storage: %s", m.storeDatabase, err.Error()) return diff --git a/services/graphite/service.go b/services/graphite/service.go index 09edd23ef90..ab9bf94d1df 100644 --- a/services/graphite/service.go +++ b/services/graphite/service.go @@ -83,8 +83,8 @@ type Service struct { } MetaClient interface { CreateDatabase(name string) (*meta.DatabaseInfo, error) - CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) - CreateRetentionPolicy(database string, rpi *meta.RetentionPolicyInfo) (*meta.RetentionPolicyInfo, error) + CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) + CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) Database(name string) *meta.DatabaseInfo RetentionPolicy(database, name string) (*meta.RetentionPolicyInfo, error) } @@ -139,14 +139,14 @@ func (s *Service) Open() error { if db := s.MetaClient.Database(s.database); db != nil { if rp, _ := s.MetaClient.RetentionPolicy(s.database, s.retentionPolicy); rp == nil { - rpi := meta.NewRetentionPolicyInfo(s.retentionPolicy) - if _, err := s.MetaClient.CreateRetentionPolicy(s.database, rpi); err != nil { + spec := meta.RetentionPolicySpec{Name: s.retentionPolicy} + if _, err := s.MetaClient.CreateRetentionPolicy(s.database, &spec); err != nil { s.logger.Printf("Failed to ensure target retention policy %s exists: %s", s.database, err.Error()) } } } else { - rpi := meta.NewRetentionPolicyInfo(s.retentionPolicy) - if _, err := s.MetaClient.CreateDatabaseWithRetentionPolicy(s.database, rpi); err != nil { + spec := meta.RetentionPolicySpec{Name: s.retentionPolicy} + if _, err := s.MetaClient.CreateDatabaseWithRetentionPolicy(s.database, &spec); err != nil { s.logger.Printf("Failed to ensure target database %s exists: %s", s.database, err.Error()) return err } diff --git a/services/graphite/service_test.go b/services/graphite/service_test.go index dbc2f8519cc..e523ae00bec 100644 --- a/services/graphite/service_test.go +++ b/services/graphite/service_test.go @@ -176,11 +176,11 @@ func (d *DatabaseCreator) CreateDatabase(name string) (*meta.DatabaseInfo, error return nil, nil } -func (d *DatabaseCreator) CreateRetentionPolicy(database string, rpi *meta.RetentionPolicyInfo) (*meta.RetentionPolicyInfo, error) { +func (d *DatabaseCreator) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) { return nil, nil } -func (d *DatabaseCreator) CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicyInfo) (*meta.DatabaseInfo, error) { +func (d *DatabaseCreator) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) { d.Created = true return nil, nil } diff --git a/services/meta/client.go b/services/meta/client.go index 4da4186f46e..cbc753a52ce 100644 --- a/services/meta/client.go +++ b/services/meta/client.go @@ -187,12 +187,11 @@ func (c *Client) CreateDatabase(name string) (*DatabaseInfo, error) { // create default retention policy if c.retentionAutoCreate { - if err := data.CreateRetentionPolicy(name, &RetentionPolicyInfo{ - ReplicaN: 1, - }); err != nil { + rpi := DefaultRetentionPolicyInfo() + if err := data.CreateRetentionPolicy(name, rpi); err != nil { return nil, err } - if err := data.SetDefaultRetentionPolicy(name, ""); err != nil { + if err := data.SetDefaultRetentionPolicy(name, rpi.Name); err != nil { return nil, err } } @@ -207,42 +206,48 @@ func (c *Client) CreateDatabase(name string) (*DatabaseInfo, error) { } // CreateDatabaseWithRetentionPolicy creates a database with the specified retention policy. -func (c *Client) CreateDatabaseWithRetentionPolicy(name string, rpi *RetentionPolicyInfo) (*DatabaseInfo, error) { +func (c *Client) CreateDatabaseWithRetentionPolicy(name string, spec *RetentionPolicySpec) (*DatabaseInfo, error) { c.mu.Lock() defer c.mu.Unlock() data := c.cacheData.Clone() - if rpi.Duration < MinRetentionPolicyDuration && rpi.Duration != 0 { + if spec.Duration != nil && *spec.Duration < MinRetentionPolicyDuration && *spec.Duration != 0 { return nil, ErrRetentionPolicyDurationTooLow } - if db := data.Database(name); db != nil { - // Check if the retention policy already exists. If it does and matches - // the desired retention policy, exit with no error. - if rp := db.RetentionPolicy(rpi.Name); rp != nil { - // Normalise ShardDuration before comparing to any existing retention policies. - rpi.ShardGroupDuration = normalisedShardDuration(rpi.ShardGroupDuration, rpi.Duration) - if rp.ReplicaN != rpi.ReplicaN || rp.Duration != rpi.Duration || rp.ShardGroupDuration != rpi.ShardGroupDuration { - return nil, ErrRetentionPolicyConflict - } - return db, nil + db := data.Database(name) + if db == nil { + if err := data.CreateDatabase(name); err != nil { + return nil, err } + db = data.Database(name) } - if err := data.CreateDatabase(name); err != nil { - return nil, err - } - - if err := data.CreateRetentionPolicy(name, rpi); err != nil { - return nil, err + rpi := spec.NewRetentionPolicyInfo() + if rp := db.RetentionPolicy(rpi.Name); rp == nil { + if err := data.CreateRetentionPolicy(name, rpi); err != nil { + return nil, err + } + } else if !spec.Matches(rp) { + // Verify that the retention policy with this name matches + // the one already created. + return nil, ErrRetentionPolicyConflict } - if err := data.SetDefaultRetentionPolicy(name, rpi.Name); err != nil { - return nil, err + // If no default retention policy has been set, set it to the retention + // policy we just created. If the default is different from what we are + // trying to create, record it as a conflict and abandon with an error. + if db.DefaultRetentionPolicy == "" { + if err := data.SetDefaultRetentionPolicy(name, rpi.Name); err != nil { + return nil, err + } + } else if rpi.Name != db.DefaultRetentionPolicy { + return nil, ErrRetentionPolicyConflict } - db := data.Database(name) + // Refresh the database info. + db = data.Database(name) if err := c.commit(data); err != nil { return nil, err @@ -270,22 +275,18 @@ func (c *Client) DropDatabase(name string) error { } // CreateRetentionPolicy creates a retention policy on the specified database. -func (c *Client) CreateRetentionPolicy(database string, rpi *RetentionPolicyInfo) (*RetentionPolicyInfo, error) { +func (c *Client) CreateRetentionPolicy(database string, spec *RetentionPolicySpec) (*RetentionPolicyInfo, error) { c.mu.Lock() defer c.mu.Unlock() data := c.cacheData.Clone() - if rpi.Duration < MinRetentionPolicyDuration && rpi.Duration != 0 { + if spec.Duration != nil && *spec.Duration < MinRetentionPolicyDuration && *spec.Duration != 0 { return nil, ErrRetentionPolicyDurationTooLow } - if err := data.CreateRetentionPolicy(database, rpi); err != nil { - return nil, err - } - - rp, err := data.RetentionPolicy(database, rpi.Name) - if err != nil { + rp := spec.NewRetentionPolicyInfo() + if err := data.CreateRetentionPolicy(database, rp); err != nil { return nil, err } diff --git a/services/meta/client_test.go b/services/meta/client_test.go index a55bb7e4688..216143f9f7b 100644 --- a/services/meta/client_test.go +++ b/services/meta/client_test.go @@ -78,13 +78,15 @@ func TestMetaClient_CreateDatabaseWithRetentionPolicy(t *testing.T) { defer os.RemoveAll(d) defer c.Close() - rpi := meta.RetentionPolicyInfo{ + duration := 1 * time.Hour + replicaN := 1 + spec := meta.RetentionPolicySpec{ Name: "rp0", - Duration: 1 * time.Hour, - ReplicaN: 1, + Duration: &duration, + ReplicaN: &replicaN, ShardGroupDuration: 2 * time.Hour, } - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &rpi); err != nil { + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &spec); err != nil { t.Fatal(err) } @@ -108,30 +110,43 @@ func TestMetaClient_CreateDatabaseWithRetentionPolicy(t *testing.T) { // Recreating the exact same database with retention policy is not // an error. - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &rpi); err != nil { + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &spec); err != nil { t.Fatal(err) } // If the rp's duration is different, an error should be returned. - rpi2 := rpi - rpi2.Duration = rpi.Duration + time.Minute - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &rpi2); err != meta.ErrRetentionPolicyConflict { + spec2 := spec + duration2 := *spec.Duration + time.Minute + spec2.Duration = &duration2 + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &spec2); err != meta.ErrRetentionPolicyConflict { t.Fatalf("got %v, but expected %v", err, meta.ErrRetentionPolicyConflict) } // If the rp's replica is different, an error should be returned. - rpi2 = rpi - rpi2.ReplicaN = rpi.ReplicaN + 1 - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &rpi2); err != meta.ErrRetentionPolicyConflict { + spec2 = spec + replica2 := *spec.ReplicaN + 1 + spec2.ReplicaN = &replica2 + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &spec2); err != meta.ErrRetentionPolicyConflict { t.Fatalf("got %v, but expected %v", err, meta.ErrRetentionPolicyConflict) } // If the rp's shard group duration is different, an error should be returned. - rpi2 = rpi - rpi2.ShardGroupDuration = rpi.ShardGroupDuration + time.Minute - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &rpi2); err != meta.ErrRetentionPolicyConflict { + spec2 = spec + spec2.ShardGroupDuration = spec.ShardGroupDuration + time.Minute + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &spec2); err != meta.ErrRetentionPolicyConflict { t.Fatalf("got %v, but expected %v", err, meta.ErrRetentionPolicyConflict) } + + // If create database is used by itself, no error should be returned and + // the default retention policy should not be changed. + if dbi, err := c.CreateDatabase("db0"); err != nil { + t.Fatalf("got %v, but expected %v", err, nil) + } else if dbi.DefaultRetentionPolicy != "rp0" { + t.Fatalf("got %v, but expected %v", dbi.DefaultRetentionPolicy, "rp0") + } else if got, exp := len(dbi.RetentionPolicies), 1; got != exp { + // Ensure no additional retention policies were created. + t.Fatalf("got %v, but expected %v", got, exp) + } } func TestMetaClient_Databases(t *testing.T) { @@ -228,7 +243,12 @@ func TestMetaClient_CreateRetentionPolicy(t *testing.T) { ShardGroupDuration: time.Hour, } - if _, err := c.CreateRetentionPolicy("db0", &rp0); err != nil { + if _, err := c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ + Name: rp0.Name, + ReplicaN: &rp0.ReplicaN, + Duration: &rp0.Duration, + ShardGroupDuration: rp0.ShardGroupDuration, + }); err != nil { t.Fatal(err) } @@ -240,7 +260,12 @@ func TestMetaClient_CreateRetentionPolicy(t *testing.T) { } // Create the same policy. Should not error. - if _, err := c.CreateRetentionPolicy("db0", &rp0); err != nil { + if _, err := c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ + Name: rp0.Name, + ReplicaN: &rp0.ReplicaN, + Duration: &rp0.Duration, + ShardGroupDuration: rp0.ShardGroupDuration, + }); err != nil { t.Fatal(err) } else if actual, err = c.RetentionPolicy("db0", "rp0"); err != nil { t.Fatal(err) @@ -253,7 +278,12 @@ func TestMetaClient_CreateRetentionPolicy(t *testing.T) { rp1 := rp0 rp1.Duration = 2 * rp0.Duration - _, got := c.CreateRetentionPolicy("db0", &rp1) + _, got := c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ + Name: rp1.Name, + ReplicaN: &rp1.ReplicaN, + Duration: &rp1.Duration, + ShardGroupDuration: rp1.ShardGroupDuration, + }) if exp := meta.ErrRetentionPolicyExists; got != exp { t.Fatalf("got error %v, expected error %v", got, exp) } @@ -263,7 +293,12 @@ func TestMetaClient_CreateRetentionPolicy(t *testing.T) { rp1 = rp0 rp1.ReplicaN = rp0.ReplicaN + 1 - _, got = c.CreateRetentionPolicy("db0", &rp1) + _, got = c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ + Name: rp1.Name, + ReplicaN: &rp1.ReplicaN, + Duration: &rp1.Duration, + ShardGroupDuration: rp1.ShardGroupDuration, + }) if exp := meta.ErrRetentionPolicyExists; got != exp { t.Fatalf("got error %v, expected error %v", got, exp) } @@ -273,7 +308,12 @@ func TestMetaClient_CreateRetentionPolicy(t *testing.T) { rp1 = rp0 rp1.ShardGroupDuration = 2 * rp0.ShardGroupDuration - _, got = c.CreateRetentionPolicy("db0", &rp1) + _, got = c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ + Name: rp1.Name, + ReplicaN: &rp1.ReplicaN, + Duration: &rp1.Duration, + ShardGroupDuration: rp1.ShardGroupDuration, + }) if exp := meta.ErrRetentionPolicyExists; got != exp { t.Fatalf("got error %v, expected error %v", got, exp) } @@ -286,10 +326,12 @@ func TestMetaClient_SetDefaultRetentionPolicy(t *testing.T) { defer os.RemoveAll(d) defer c.Close() - if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &meta.RetentionPolicyInfo{ + duration := 1 * time.Hour + replicaN := 1 + if _, err := c.CreateDatabaseWithRetentionPolicy("db0", &meta.RetentionPolicySpec{ Name: "rp0", - Duration: 1 * time.Hour, - ReplicaN: 1, + Duration: &duration, + ReplicaN: &replicaN, }); err != nil { t.Fatal(err) } @@ -336,10 +378,12 @@ func TestMetaClient_DropRetentionPolicy(t *testing.T) { t.Fatalf("db name wrong: %s", db.Name) } - if _, err := c.CreateRetentionPolicy("db0", &meta.RetentionPolicyInfo{ + duration := 1 * time.Hour + replicaN := 1 + if _, err := c.CreateRetentionPolicy("db0", &meta.RetentionPolicySpec{ Name: "rp0", - Duration: 1 * time.Hour, - ReplicaN: 1, + Duration: &duration, + ReplicaN: &replicaN, }); err != nil { t.Fatal(err) } diff --git a/services/meta/data.go b/services/meta/data.go index 3ced75b3d8a..89c0bf2f082 100644 --- a/services/meta/data.go +++ b/services/meta/data.go @@ -22,7 +22,7 @@ const ( DefaultRetentionPolicyReplicaN = 1 // DefaultRetentionPolicyDuration is the default value of RetentionPolicyInfo.Duration. - DefaultRetentionPolicyDuration = 7 * (24 * time.Hour) + DefaultRetentionPolicyDuration = time.Duration(0) // DefaultRetentionPolicyName is the default name for auto generated retention policies. DefaultRetentionPolicyName = "autogen" @@ -137,12 +137,17 @@ func (data *Data) RetentionPolicy(database, name string) (*RetentionPolicyInfo, // Returns an error if name is blank or if a database does not exist. func (data *Data) CreateRetentionPolicy(database string, rpi *RetentionPolicyInfo) error { // Validate retention policy. - if rpi.ReplicaN < 1 { + if rpi == nil { + return ErrRetentionPolicyRequired + } else if rpi.Name == "" { + return ErrRetentionPolicyNameRequired + } else if rpi.ReplicaN < 1 { return ErrReplicationFactorTooLow } // Normalise ShardDuration before comparing to any existing - // retention policies + // retention policies. The client is supposed to do this, but + // do it again to verify input. rpi.ShardGroupDuration = normalisedShardDuration(rpi.ShardGroupDuration, rpi.Duration) // Find database. @@ -150,27 +155,15 @@ func (data *Data) CreateRetentionPolicy(database string, rpi *RetentionPolicyInf if di == nil { return influxdb.ErrDatabaseNotFound(database) } else if rp := di.RetentionPolicy(rpi.Name); rp != nil { - // RP with that name already exists. Make sure they're the same. + // RP with that name already exists. Make sure they're the same. if rp.ReplicaN != rpi.ReplicaN || rp.Duration != rpi.Duration || rp.ShardGroupDuration != rpi.ShardGroupDuration { return ErrRetentionPolicyExists } return nil } - // Determine the retention policy name if it is blank. - rpName := rpi.Name - if rpName == "" { - rpName = DefaultRetentionPolicyName - } - // Append copy of new policy. - rp := RetentionPolicyInfo{ - Name: rpName, - Duration: rpi.Duration, - ReplicaN: rpi.ReplicaN, - ShardGroupDuration: rpi.ShardGroupDuration, - } - di.RetentionPolicies = append(di.RetentionPolicies, rp) + di.RetentionPolicies = append(di.RetentionPolicies, *rpi) return nil } @@ -844,6 +837,93 @@ func (di *DatabaseInfo) unmarshal(pb *internal.DatabaseInfo) { } } +// RetentionPolicySpec represents the specification for a new retention policy. +type RetentionPolicySpec struct { + Name string + ReplicaN *int + Duration *time.Duration + ShardGroupDuration time.Duration +} + +// NewRetentionPolicyInfo creates a new retention policy info from the specification. +func (s *RetentionPolicySpec) NewRetentionPolicyInfo() *RetentionPolicyInfo { + return DefaultRetentionPolicyInfo().Apply(s) +} + +// Matches checks if this retention policy specification matches +// an existing retention policy. +func (s *RetentionPolicySpec) Matches(rpi *RetentionPolicyInfo) bool { + if rpi == nil { + return false + } else if s.Name != "" && s.Name != rpi.Name { + return false + } else if s.Duration != nil && *s.Duration != rpi.Duration { + return false + } else if s.ReplicaN != nil && *s.ReplicaN != rpi.ReplicaN { + return false + } + + // Normalise ShardDuration before comparing to any existing retention policies. + // Normalize with the retention policy info's duration instead of the spec + // since they should be the same and we're performing a comparison. + sgDuration := normalisedShardDuration(s.ShardGroupDuration, rpi.Duration) + if sgDuration != rpi.ShardGroupDuration { + return false + } + return true +} + +// marshal serializes to a protobuf representation. +func (s *RetentionPolicySpec) marshal() *internal.RetentionPolicySpec { + pb := &internal.RetentionPolicySpec{} + if s.Name != "" { + pb.Name = proto.String(s.Name) + } + if s.Duration != nil { + pb.Duration = proto.Int64(int64(*s.Duration)) + } + if s.ShardGroupDuration > 0 { + pb.ShardGroupDuration = proto.Int64(int64(s.ShardGroupDuration)) + } + if s.ReplicaN != nil { + pb.ReplicaN = proto.Uint32(uint32(*s.ReplicaN)) + } + return pb +} + +// unmarshal deserializes from a protobuf representation. +func (s *RetentionPolicySpec) unmarshal(pb *internal.RetentionPolicySpec) { + if pb.Name != nil { + s.Name = pb.GetName() + } + if pb.Duration != nil { + duration := time.Duration(pb.GetDuration()) + s.Duration = &duration + } + if pb.ShardGroupDuration != nil { + s.ShardGroupDuration = time.Duration(pb.GetShardGroupDuration()) + } + if pb.ReplicaN != nil { + replicaN := int(pb.GetReplicaN()) + s.ReplicaN = &replicaN + } +} + +// MarshalBinary encodes RetentionPolicySpec to a binary format. +func (s *RetentionPolicySpec) MarshalBinary() ([]byte, error) { + return proto.Marshal(s.marshal()) +} + +// UnmarshalBinary decodes RetentionPolicySpec from a binary format. +func (s *RetentionPolicySpec) UnmarshalBinary(data []byte) error { + var pb internal.RetentionPolicySpec + if err := proto.Unmarshal(data, &pb); err != nil { + return err + } + s.unmarshal(&pb) + return nil +} + // RetentionPolicyInfo represents metadata about a retention policy. type RetentionPolicyInfo struct { Name string @@ -863,6 +943,32 @@ func NewRetentionPolicyInfo(name string) *RetentionPolicyInfo { } } +// DefaultRetentionPolicyInfo returns a new instance of RetentionPolicyInfo with defaults set. +func DefaultRetentionPolicyInfo() *RetentionPolicyInfo { + return NewRetentionPolicyInfo(DefaultRetentionPolicyName) +} + +// Apply applies a specification to the retention policy info. +func (rpi *RetentionPolicyInfo) Apply(spec *RetentionPolicySpec) *RetentionPolicyInfo { + rp := &RetentionPolicyInfo{ + Name: rpi.Name, + ReplicaN: rpi.ReplicaN, + Duration: rpi.Duration, + ShardGroupDuration: rpi.ShardGroupDuration, + } + if spec.Name != "" { + rp.Name = spec.Name + } + if spec.ReplicaN != nil { + rp.ReplicaN = *spec.ReplicaN + } + if spec.Duration != nil { + rp.Duration = *spec.Duration + } + rp.ShardGroupDuration = normalisedShardDuration(spec.ShardGroupDuration, rp.Duration) + return rp +} + // ShardGroupByTimestamp returns the shard group in the policy that contains the timestamp. func (rpi *RetentionPolicyInfo) ShardGroupByTimestamp(timestamp time.Time) *ShardGroupInfo { for i := range rpi.ShardGroups { diff --git a/services/meta/errors.go b/services/meta/errors.go index 9d961e8ebe7..a028cd4fadf 100644 --- a/services/meta/errors.go +++ b/services/meta/errors.go @@ -35,6 +35,10 @@ var ( // on a default retention policy. ErrRetentionPolicyDefault = errors.New("retention policy is default") + // ErrRetentionPolicyRequired is returned when a retention policy is required + // by an operation, but a nil policy was passed. + ErrRetentionPolicyRequired = errors.New("retention policy required") + // ErrRetentionPolicyNameRequired is returned when creating a policy without a name. ErrRetentionPolicyNameRequired = errors.New("retention policy name required") diff --git a/services/meta/internal/meta.pb.go b/services/meta/internal/meta.pb.go index 0685195d61a..013ffd4b408 100644 --- a/services/meta/internal/meta.pb.go +++ b/services/meta/internal/meta.pb.go @@ -12,6 +12,7 @@ It has these top-level messages: Data NodeInfo DatabaseInfo + RetentionPolicySpec RetentionPolicyInfo ShardGroupInfo ShardInfo @@ -182,7 +183,7 @@ func (x *Command_Type) UnmarshalJSON(data []byte) error { *x = Command_Type(value) return nil } -func (Command_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorMeta, []int{11, 0} } +func (Command_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorMeta, []int{12, 0} } type Data struct { Term *uint64 `protobuf:"varint,1,req,name=Term" json:"Term,omitempty"` @@ -356,6 +357,47 @@ func (m *DatabaseInfo) GetContinuousQueries() []*ContinuousQueryInfo { return nil } +type RetentionPolicySpec struct { + Name *string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"` + Duration *int64 `protobuf:"varint,2,opt,name=Duration" json:"Duration,omitempty"` + ShardGroupDuration *int64 `protobuf:"varint,3,opt,name=ShardGroupDuration" json:"ShardGroupDuration,omitempty"` + ReplicaN *uint32 `protobuf:"varint,4,opt,name=ReplicaN" json:"ReplicaN,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RetentionPolicySpec) Reset() { *m = RetentionPolicySpec{} } +func (m *RetentionPolicySpec) String() string { return proto.CompactTextString(m) } +func (*RetentionPolicySpec) ProtoMessage() {} +func (*RetentionPolicySpec) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{3} } + +func (m *RetentionPolicySpec) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *RetentionPolicySpec) GetDuration() int64 { + if m != nil && m.Duration != nil { + return *m.Duration + } + return 0 +} + +func (m *RetentionPolicySpec) GetShardGroupDuration() int64 { + if m != nil && m.ShardGroupDuration != nil { + return *m.ShardGroupDuration + } + return 0 +} + +func (m *RetentionPolicySpec) GetReplicaN() uint32 { + if m != nil && m.ReplicaN != nil { + return *m.ReplicaN + } + return 0 +} + type RetentionPolicyInfo struct { Name *string `protobuf:"bytes,1,req,name=Name" json:"Name,omitempty"` Duration *int64 `protobuf:"varint,2,req,name=Duration" json:"Duration,omitempty"` @@ -369,7 +411,7 @@ type RetentionPolicyInfo struct { func (m *RetentionPolicyInfo) Reset() { *m = RetentionPolicyInfo{} } func (m *RetentionPolicyInfo) String() string { return proto.CompactTextString(m) } func (*RetentionPolicyInfo) ProtoMessage() {} -func (*RetentionPolicyInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{3} } +func (*RetentionPolicyInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{4} } func (m *RetentionPolicyInfo) GetName() string { if m != nil && m.Name != nil { @@ -426,7 +468,7 @@ type ShardGroupInfo struct { func (m *ShardGroupInfo) Reset() { *m = ShardGroupInfo{} } func (m *ShardGroupInfo) String() string { return proto.CompactTextString(m) } func (*ShardGroupInfo) ProtoMessage() {} -func (*ShardGroupInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{4} } +func (*ShardGroupInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{5} } func (m *ShardGroupInfo) GetID() uint64 { if m != nil && m.ID != nil { @@ -480,7 +522,7 @@ type ShardInfo struct { func (m *ShardInfo) Reset() { *m = ShardInfo{} } func (m *ShardInfo) String() string { return proto.CompactTextString(m) } func (*ShardInfo) ProtoMessage() {} -func (*ShardInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{5} } +func (*ShardInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{6} } func (m *ShardInfo) GetID() uint64 { if m != nil && m.ID != nil { @@ -513,7 +555,7 @@ type SubscriptionInfo struct { func (m *SubscriptionInfo) Reset() { *m = SubscriptionInfo{} } func (m *SubscriptionInfo) String() string { return proto.CompactTextString(m) } func (*SubscriptionInfo) ProtoMessage() {} -func (*SubscriptionInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{6} } +func (*SubscriptionInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{7} } func (m *SubscriptionInfo) GetName() string { if m != nil && m.Name != nil { @@ -544,7 +586,7 @@ type ShardOwner struct { func (m *ShardOwner) Reset() { *m = ShardOwner{} } func (m *ShardOwner) String() string { return proto.CompactTextString(m) } func (*ShardOwner) ProtoMessage() {} -func (*ShardOwner) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{7} } +func (*ShardOwner) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{8} } func (m *ShardOwner) GetNodeID() uint64 { if m != nil && m.NodeID != nil { @@ -562,7 +604,7 @@ type ContinuousQueryInfo struct { func (m *ContinuousQueryInfo) Reset() { *m = ContinuousQueryInfo{} } func (m *ContinuousQueryInfo) String() string { return proto.CompactTextString(m) } func (*ContinuousQueryInfo) ProtoMessage() {} -func (*ContinuousQueryInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{8} } +func (*ContinuousQueryInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{9} } func (m *ContinuousQueryInfo) GetName() string { if m != nil && m.Name != nil { @@ -589,7 +631,7 @@ type UserInfo struct { func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} -func (*UserInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{9} } +func (*UserInfo) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{10} } func (m *UserInfo) GetName() string { if m != nil && m.Name != nil { @@ -628,7 +670,7 @@ type UserPrivilege struct { func (m *UserPrivilege) Reset() { *m = UserPrivilege{} } func (m *UserPrivilege) String() string { return proto.CompactTextString(m) } func (*UserPrivilege) ProtoMessage() {} -func (*UserPrivilege) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{10} } +func (*UserPrivilege) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{11} } func (m *UserPrivilege) GetDatabase() string { if m != nil && m.Database != nil { @@ -653,7 +695,7 @@ type Command struct { func (m *Command) Reset() { *m = Command{} } func (m *Command) String() string { return proto.CompactTextString(m) } func (*Command) ProtoMessage() {} -func (*Command) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{11} } +func (*Command) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{12} } var extRange_Command = []proto.ExtensionRange{ {100, 536870911}, @@ -681,7 +723,7 @@ type CreateNodeCommand struct { func (m *CreateNodeCommand) Reset() { *m = CreateNodeCommand{} } func (m *CreateNodeCommand) String() string { return proto.CompactTextString(m) } func (*CreateNodeCommand) ProtoMessage() {} -func (*CreateNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{12} } +func (*CreateNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{13} } func (m *CreateNodeCommand) GetHost() string { if m != nil && m.Host != nil { @@ -714,7 +756,7 @@ type DeleteNodeCommand struct { func (m *DeleteNodeCommand) Reset() { *m = DeleteNodeCommand{} } func (m *DeleteNodeCommand) String() string { return proto.CompactTextString(m) } func (*DeleteNodeCommand) ProtoMessage() {} -func (*DeleteNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{13} } +func (*DeleteNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{14} } func (m *DeleteNodeCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -747,7 +789,7 @@ type CreateDatabaseCommand struct { func (m *CreateDatabaseCommand) Reset() { *m = CreateDatabaseCommand{} } func (m *CreateDatabaseCommand) String() string { return proto.CompactTextString(m) } func (*CreateDatabaseCommand) ProtoMessage() {} -func (*CreateDatabaseCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{14} } +func (*CreateDatabaseCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{15} } func (m *CreateDatabaseCommand) GetName() string { if m != nil && m.Name != nil { @@ -779,7 +821,7 @@ type DropDatabaseCommand struct { func (m *DropDatabaseCommand) Reset() { *m = DropDatabaseCommand{} } func (m *DropDatabaseCommand) String() string { return proto.CompactTextString(m) } func (*DropDatabaseCommand) ProtoMessage() {} -func (*DropDatabaseCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{15} } +func (*DropDatabaseCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{16} } func (m *DropDatabaseCommand) GetName() string { if m != nil && m.Name != nil { @@ -806,7 +848,7 @@ func (m *CreateRetentionPolicyCommand) Reset() { *m = CreateRetentionPol func (m *CreateRetentionPolicyCommand) String() string { return proto.CompactTextString(m) } func (*CreateRetentionPolicyCommand) ProtoMessage() {} func (*CreateRetentionPolicyCommand) Descriptor() ([]byte, []int) { - return fileDescriptorMeta, []int{16} + return fileDescriptorMeta, []int{17} } func (m *CreateRetentionPolicyCommand) GetDatabase() string { @@ -840,7 +882,7 @@ type DropRetentionPolicyCommand struct { func (m *DropRetentionPolicyCommand) Reset() { *m = DropRetentionPolicyCommand{} } func (m *DropRetentionPolicyCommand) String() string { return proto.CompactTextString(m) } func (*DropRetentionPolicyCommand) ProtoMessage() {} -func (*DropRetentionPolicyCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{17} } +func (*DropRetentionPolicyCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{18} } func (m *DropRetentionPolicyCommand) GetDatabase() string { if m != nil && m.Database != nil { @@ -874,7 +916,7 @@ func (m *SetDefaultRetentionPolicyCommand) Reset() { *m = SetDefaultRete func (m *SetDefaultRetentionPolicyCommand) String() string { return proto.CompactTextString(m) } func (*SetDefaultRetentionPolicyCommand) ProtoMessage() {} func (*SetDefaultRetentionPolicyCommand) Descriptor() ([]byte, []int) { - return fileDescriptorMeta, []int{18} + return fileDescriptorMeta, []int{19} } func (m *SetDefaultRetentionPolicyCommand) GetDatabase() string { @@ -912,7 +954,7 @@ func (m *UpdateRetentionPolicyCommand) Reset() { *m = UpdateRetentionPol func (m *UpdateRetentionPolicyCommand) String() string { return proto.CompactTextString(m) } func (*UpdateRetentionPolicyCommand) ProtoMessage() {} func (*UpdateRetentionPolicyCommand) Descriptor() ([]byte, []int) { - return fileDescriptorMeta, []int{19} + return fileDescriptorMeta, []int{20} } func (m *UpdateRetentionPolicyCommand) GetDatabase() string { @@ -968,7 +1010,7 @@ type CreateShardGroupCommand struct { func (m *CreateShardGroupCommand) Reset() { *m = CreateShardGroupCommand{} } func (m *CreateShardGroupCommand) String() string { return proto.CompactTextString(m) } func (*CreateShardGroupCommand) ProtoMessage() {} -func (*CreateShardGroupCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{20} } +func (*CreateShardGroupCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{21} } func (m *CreateShardGroupCommand) GetDatabase() string { if m != nil && m.Database != nil { @@ -1009,7 +1051,7 @@ type DeleteShardGroupCommand struct { func (m *DeleteShardGroupCommand) Reset() { *m = DeleteShardGroupCommand{} } func (m *DeleteShardGroupCommand) String() string { return proto.CompactTextString(m) } func (*DeleteShardGroupCommand) ProtoMessage() {} -func (*DeleteShardGroupCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{21} } +func (*DeleteShardGroupCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{22} } func (m *DeleteShardGroupCommand) GetDatabase() string { if m != nil && m.Database != nil { @@ -1051,7 +1093,7 @@ func (m *CreateContinuousQueryCommand) Reset() { *m = CreateContinuousQu func (m *CreateContinuousQueryCommand) String() string { return proto.CompactTextString(m) } func (*CreateContinuousQueryCommand) ProtoMessage() {} func (*CreateContinuousQueryCommand) Descriptor() ([]byte, []int) { - return fileDescriptorMeta, []int{22} + return fileDescriptorMeta, []int{23} } func (m *CreateContinuousQueryCommand) GetDatabase() string { @@ -1092,7 +1134,7 @@ type DropContinuousQueryCommand struct { func (m *DropContinuousQueryCommand) Reset() { *m = DropContinuousQueryCommand{} } func (m *DropContinuousQueryCommand) String() string { return proto.CompactTextString(m) } func (*DropContinuousQueryCommand) ProtoMessage() {} -func (*DropContinuousQueryCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{23} } +func (*DropContinuousQueryCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{24} } func (m *DropContinuousQueryCommand) GetDatabase() string { if m != nil && m.Database != nil { @@ -1126,7 +1168,7 @@ type CreateUserCommand struct { func (m *CreateUserCommand) Reset() { *m = CreateUserCommand{} } func (m *CreateUserCommand) String() string { return proto.CompactTextString(m) } func (*CreateUserCommand) ProtoMessage() {} -func (*CreateUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{24} } +func (*CreateUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{25} } func (m *CreateUserCommand) GetName() string { if m != nil && m.Name != nil { @@ -1165,7 +1207,7 @@ type DropUserCommand struct { func (m *DropUserCommand) Reset() { *m = DropUserCommand{} } func (m *DropUserCommand) String() string { return proto.CompactTextString(m) } func (*DropUserCommand) ProtoMessage() {} -func (*DropUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{25} } +func (*DropUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{26} } func (m *DropUserCommand) GetName() string { if m != nil && m.Name != nil { @@ -1191,7 +1233,7 @@ type UpdateUserCommand struct { func (m *UpdateUserCommand) Reset() { *m = UpdateUserCommand{} } func (m *UpdateUserCommand) String() string { return proto.CompactTextString(m) } func (*UpdateUserCommand) ProtoMessage() {} -func (*UpdateUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{26} } +func (*UpdateUserCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{27} } func (m *UpdateUserCommand) GetName() string { if m != nil && m.Name != nil { @@ -1225,7 +1267,7 @@ type SetPrivilegeCommand struct { func (m *SetPrivilegeCommand) Reset() { *m = SetPrivilegeCommand{} } func (m *SetPrivilegeCommand) String() string { return proto.CompactTextString(m) } func (*SetPrivilegeCommand) ProtoMessage() {} -func (*SetPrivilegeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{27} } +func (*SetPrivilegeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{28} } func (m *SetPrivilegeCommand) GetUsername() string { if m != nil && m.Username != nil { @@ -1264,7 +1306,7 @@ type SetDataCommand struct { func (m *SetDataCommand) Reset() { *m = SetDataCommand{} } func (m *SetDataCommand) String() string { return proto.CompactTextString(m) } func (*SetDataCommand) ProtoMessage() {} -func (*SetDataCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{28} } +func (*SetDataCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{29} } func (m *SetDataCommand) GetData() *Data { if m != nil { @@ -1290,7 +1332,7 @@ type SetAdminPrivilegeCommand struct { func (m *SetAdminPrivilegeCommand) Reset() { *m = SetAdminPrivilegeCommand{} } func (m *SetAdminPrivilegeCommand) String() string { return proto.CompactTextString(m) } func (*SetAdminPrivilegeCommand) ProtoMessage() {} -func (*SetAdminPrivilegeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{29} } +func (*SetAdminPrivilegeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{30} } func (m *SetAdminPrivilegeCommand) GetUsername() string { if m != nil && m.Username != nil { @@ -1323,7 +1365,7 @@ type UpdateNodeCommand struct { func (m *UpdateNodeCommand) Reset() { *m = UpdateNodeCommand{} } func (m *UpdateNodeCommand) String() string { return proto.CompactTextString(m) } func (*UpdateNodeCommand) ProtoMessage() {} -func (*UpdateNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{30} } +func (*UpdateNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{31} } func (m *UpdateNodeCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1359,7 +1401,7 @@ type CreateSubscriptionCommand struct { func (m *CreateSubscriptionCommand) Reset() { *m = CreateSubscriptionCommand{} } func (m *CreateSubscriptionCommand) String() string { return proto.CompactTextString(m) } func (*CreateSubscriptionCommand) ProtoMessage() {} -func (*CreateSubscriptionCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{31} } +func (*CreateSubscriptionCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{32} } func (m *CreateSubscriptionCommand) GetName() string { if m != nil && m.Name != nil { @@ -1414,7 +1456,7 @@ type DropSubscriptionCommand struct { func (m *DropSubscriptionCommand) Reset() { *m = DropSubscriptionCommand{} } func (m *DropSubscriptionCommand) String() string { return proto.CompactTextString(m) } func (*DropSubscriptionCommand) ProtoMessage() {} -func (*DropSubscriptionCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{32} } +func (*DropSubscriptionCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{33} } func (m *DropSubscriptionCommand) GetName() string { if m != nil && m.Name != nil { @@ -1454,7 +1496,7 @@ type RemovePeerCommand struct { func (m *RemovePeerCommand) Reset() { *m = RemovePeerCommand{} } func (m *RemovePeerCommand) String() string { return proto.CompactTextString(m) } func (*RemovePeerCommand) ProtoMessage() {} -func (*RemovePeerCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{33} } +func (*RemovePeerCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{34} } func (m *RemovePeerCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1488,7 +1530,7 @@ type CreateMetaNodeCommand struct { func (m *CreateMetaNodeCommand) Reset() { *m = CreateMetaNodeCommand{} } func (m *CreateMetaNodeCommand) String() string { return proto.CompactTextString(m) } func (*CreateMetaNodeCommand) ProtoMessage() {} -func (*CreateMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{34} } +func (*CreateMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{35} } func (m *CreateMetaNodeCommand) GetHTTPAddr() string { if m != nil && m.HTTPAddr != nil { @@ -1528,7 +1570,7 @@ type CreateDataNodeCommand struct { func (m *CreateDataNodeCommand) Reset() { *m = CreateDataNodeCommand{} } func (m *CreateDataNodeCommand) String() string { return proto.CompactTextString(m) } func (*CreateDataNodeCommand) ProtoMessage() {} -func (*CreateDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{35} } +func (*CreateDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{36} } func (m *CreateDataNodeCommand) GetHTTPAddr() string { if m != nil && m.HTTPAddr != nil { @@ -1562,7 +1604,7 @@ type UpdateDataNodeCommand struct { func (m *UpdateDataNodeCommand) Reset() { *m = UpdateDataNodeCommand{} } func (m *UpdateDataNodeCommand) String() string { return proto.CompactTextString(m) } func (*UpdateDataNodeCommand) ProtoMessage() {} -func (*UpdateDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{36} } +func (*UpdateDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{37} } func (m *UpdateDataNodeCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1601,7 +1643,7 @@ type DeleteMetaNodeCommand struct { func (m *DeleteMetaNodeCommand) Reset() { *m = DeleteMetaNodeCommand{} } func (m *DeleteMetaNodeCommand) String() string { return proto.CompactTextString(m) } func (*DeleteMetaNodeCommand) ProtoMessage() {} -func (*DeleteMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{37} } +func (*DeleteMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{38} } func (m *DeleteMetaNodeCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1626,7 +1668,7 @@ type DeleteDataNodeCommand struct { func (m *DeleteDataNodeCommand) Reset() { *m = DeleteDataNodeCommand{} } func (m *DeleteDataNodeCommand) String() string { return proto.CompactTextString(m) } func (*DeleteDataNodeCommand) ProtoMessage() {} -func (*DeleteDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{38} } +func (*DeleteDataNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{39} } func (m *DeleteDataNodeCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1653,7 +1695,7 @@ type Response struct { func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{39} } +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{40} } func (m *Response) GetOK() bool { if m != nil && m.OK != nil { @@ -1688,7 +1730,7 @@ type SetMetaNodeCommand struct { func (m *SetMetaNodeCommand) Reset() { *m = SetMetaNodeCommand{} } func (m *SetMetaNodeCommand) String() string { return proto.CompactTextString(m) } func (*SetMetaNodeCommand) ProtoMessage() {} -func (*SetMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{40} } +func (*SetMetaNodeCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{41} } func (m *SetMetaNodeCommand) GetHTTPAddr() string { if m != nil && m.HTTPAddr != nil { @@ -1727,7 +1769,7 @@ type DropShardCommand struct { func (m *DropShardCommand) Reset() { *m = DropShardCommand{} } func (m *DropShardCommand) String() string { return proto.CompactTextString(m) } func (*DropShardCommand) ProtoMessage() {} -func (*DropShardCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{41} } +func (*DropShardCommand) Descriptor() ([]byte, []int) { return fileDescriptorMeta, []int{42} } func (m *DropShardCommand) GetID() uint64 { if m != nil && m.ID != nil { @@ -1748,6 +1790,7 @@ func init() { proto.RegisterType((*Data)(nil), "meta.Data") proto.RegisterType((*NodeInfo)(nil), "meta.NodeInfo") proto.RegisterType((*DatabaseInfo)(nil), "meta.DatabaseInfo") + proto.RegisterType((*RetentionPolicySpec)(nil), "meta.RetentionPolicySpec") proto.RegisterType((*RetentionPolicyInfo)(nil), "meta.RetentionPolicyInfo") proto.RegisterType((*ShardGroupInfo)(nil), "meta.ShardGroupInfo") proto.RegisterType((*ShardInfo)(nil), "meta.ShardInfo") @@ -1822,104 +1865,106 @@ func init() { func init() { proto.RegisterFile("internal/meta.proto", fileDescriptorMeta) } var fileDescriptorMeta = []byte{ - // 1582 bytes of a gzipped FileDescriptorProto + // 1603 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x58, 0xdd, 0x6f, 0x1b, 0x45, - 0x10, 0xd7, 0xf9, 0x2b, 0xf6, 0xba, 0x4e, 0xdc, 0x73, 0x3e, 0x9c, 0x36, 0x6d, 0xc3, 0x8a, 0x8f, - 0x80, 0x44, 0x91, 0xac, 0x54, 0x08, 0xf1, 0xd9, 0xc6, 0x2d, 0xad, 0x50, 0xd3, 0x90, 0xb8, 0xf0, - 0x86, 0xb8, 0xc6, 0x9b, 0xc6, 0x60, 0xdf, 0x99, 0xbb, 0x73, 0xd3, 0x52, 0x68, 0x0b, 0x12, 0x42, - 0x20, 0x21, 0xc1, 0x0b, 0x2f, 0x3c, 0xf1, 0xc6, 0x7f, 0x80, 0x78, 0xe0, 0xaf, 0xe0, 0x1f, 0x62, - 0x76, 0xf6, 0xf6, 0x6e, 0xef, 0x6e, 0xf7, 0xdc, 0x36, 0x4f, 0xf1, 0xcc, 0xec, 0xfc, 0x7e, 0x3b, - 0xb3, 0x33, 0x3b, 0x7b, 0xa4, 0x33, 0x72, 0x43, 0xe6, 0xbb, 0xce, 0xf8, 0x8d, 0x09, 0x0b, 0x9d, - 0x8b, 0x53, 0xdf, 0x0b, 0x3d, 0xbb, 0xc2, 0xff, 0xa7, 0x7f, 0x96, 0x48, 0xa5, 0xef, 0x84, 0x8e, - 0x7d, 0x8a, 0x54, 0x06, 0xcc, 0x9f, 0x74, 0xad, 0xcd, 0xd2, 0x56, 0xc5, 0x6e, 0x91, 0xea, 0x0d, - 0x77, 0xc8, 0xee, 0x77, 0x4b, 0xf8, 0xf3, 0x34, 0x69, 0xec, 0x8c, 0x67, 0x01, 0x38, 0xb9, 0xd1, - 0xef, 0x96, 0x51, 0x74, 0x8e, 0x54, 0x77, 0xbd, 0x21, 0x0b, 0xba, 0x95, 0xcd, 0xf2, 0x56, 0xb3, - 0xb7, 0x78, 0x11, 0x5d, 0x73, 0xd1, 0x0d, 0xf7, 0xc8, 0xb3, 0x5f, 0x22, 0x0d, 0xee, 0xf6, 0x8e, - 0x13, 0x80, 0x49, 0x15, 0x4d, 0x6c, 0x61, 0x22, 0xc5, 0x68, 0x06, 0x5e, 0x6e, 0x07, 0xcc, 0x0f, - 0xba, 0x35, 0xd5, 0x0b, 0x17, 0xa1, 0x1a, 0x70, 0x6f, 0x3a, 0xf7, 0xd1, 0x69, 0xbf, 0xbb, 0x80, - 0xb8, 0x6b, 0x64, 0x09, 0x44, 0x07, 0xc7, 0x8e, 0x3f, 0xfc, 0xd0, 0xf7, 0x66, 0x53, 0x50, 0xd4, - 0x51, 0x61, 0x13, 0x22, 0x15, 0x20, 0x6b, 0xa0, 0xec, 0x05, 0xc1, 0x42, 0x10, 0x25, 0x5a, 0xa2, - 0x60, 0x72, 0x93, 0x49, 0x93, 0xa6, 0xce, 0x84, 0x5e, 0x22, 0xf5, 0xd8, 0x9c, 0x90, 0x12, 0x78, - 0x17, 0x41, 0x82, 0x90, 0x5d, 0xf7, 0x82, 0x10, 0x63, 0xd4, 0xb0, 0x97, 0xc8, 0xc2, 0x60, 0x67, - 0x0f, 0x05, 0xe5, 0x4d, 0x6b, 0xab, 0x41, 0xff, 0xb2, 0xc8, 0xa9, 0xd4, 0x66, 0xc1, 0x7e, 0xd7, - 0x99, 0x30, 0x5c, 0xdd, 0xb0, 0xcf, 0x93, 0xd5, 0x3e, 0x3b, 0x72, 0x66, 0xe3, 0x70, 0x9f, 0x85, - 0xcc, 0x0d, 0x47, 0x9e, 0xbb, 0xe7, 0x8d, 0x47, 0x87, 0x0f, 0x22, 0x7f, 0xdb, 0xe4, 0x74, 0x5a, - 0x31, 0x02, 0x82, 0x65, 0x24, 0xb8, 0x2e, 0x08, 0x66, 0xd6, 0x21, 0x06, 0xac, 0xda, 0xf1, 0x40, - 0xe8, 0xce, 0xbc, 0x59, 0xf0, 0xf1, 0x8c, 0xf9, 0xa3, 0x38, 0x45, 0xd1, 0xaa, 0xb4, 0x1a, 0x57, - 0xd1, 0x7f, 0x2d, 0xd2, 0xd1, 0x79, 0x4b, 0x33, 0x6e, 0x93, 0x7a, 0x7f, 0xe6, 0x3b, 0xdc, 0x06, - 0x39, 0x96, 0xed, 0x33, 0xc4, 0x4e, 0x32, 0x11, 0xeb, 0xca, 0xa8, 0x03, 0xeb, 0x7d, 0x36, 0x05, - 0x57, 0xce, 0x2e, 0x10, 0x28, 0x6d, 0xb5, 0xec, 0x57, 0x49, 0x33, 0xb1, 0x96, 0xa7, 0x62, 0x59, - 0xb0, 0x52, 0x12, 0xca, 0x81, 0x5f, 0x27, 0xad, 0x83, 0xd9, 0x9d, 0xe0, 0xd0, 0x1f, 0x4d, 0xb9, - 0x4b, 0x79, 0x3e, 0x56, 0x23, 0x63, 0x45, 0x85, 0xfc, 0x7f, 0xb2, 0xc8, 0x62, 0xc6, 0x83, 0x9a, - 0x28, 0x38, 0x46, 0x07, 0xa1, 0xe3, 0x87, 0x83, 0x11, 0xec, 0x45, 0x30, 0x87, 0x6c, 0x5d, 0x75, - 0x87, 0x28, 0x10, 0x74, 0xc1, 0xa6, 0xcf, 0xc6, 0x10, 0x83, 0xe1, 0xe5, 0x10, 0xf9, 0x96, 0xed, - 0x0b, 0xa4, 0x86, 0x4e, 0x25, 0xd5, 0x25, 0x85, 0x2a, 0x62, 0x74, 0x48, 0x73, 0xe0, 0xcf, 0xdc, - 0x43, 0x47, 0x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, 0x9e, 0xf6, 0x73, 0x5d, 0x31, + 0x81, 0x47, 0x2a, 0x01, 0x2d, 0x0e, 0x34, 0x20, 0xfd, 0x43, 0x49, 0x25, 0x50, 0x80, 0xf0, 0x58, + 0x45, 0xd0, 0x3a, 0x22, 0x8e, 0xe1, 0xbd, 0x95, 0x42, 0x78, 0xc7, 0x88, 0xf0, 0xc4, 0xca, 0x43, + 0x64, 0x37, 0xb1, 0xc3, 0xe6, 0xb2, 0x60, 0x06, 0x87, 0x92, 0x32, 0xaf, 0xb7, 0x3e, 0xe2, 0x5e, + 0xeb, 0xac, 0x9b, 0x5d, 0xf5, 0x7d, 0xcf, 0xe7, 0x4f, 0x92, 0x46, 0xf2, 0x6d, 0x98, 0xcd, 0x77, + 0x15, 0xf2, 0xc4, 0xd2, 0x3d, 0xf7, 0x9e, 0xbd, 0xf2, 0xcc, 0xed, 0xff, 0x3b, 0xc1, 0xbd, 0x1b, + 0x77, 0xc9, 0x6c, 0x6c, 0x3e, 0xcd, 0x3f, 0x2c, 0x53, 0x61, 0x31, 0x1f, 0xac, 0xef, 0x85, 0xeb, + 0x75, 0xe5, 0x1c, 0x2b, 0x4e, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xc6, 0xc9, 0x45, 0x39, + 0x17, 0x00, 0x00, } diff --git a/services/meta/internal/meta.proto b/services/meta/internal/meta.proto index 2fc51283519..dd94d417a84 100644 --- a/services/meta/internal/meta.proto +++ b/services/meta/internal/meta.proto @@ -37,6 +37,13 @@ message DatabaseInfo { repeated ContinuousQueryInfo ContinuousQueries = 4; } +message RetentionPolicySpec { + optional string Name = 1; + optional int64 Duration = 2; + optional int64 ShardGroupDuration = 3; + optional uint32 ReplicaN = 4; +} + message RetentionPolicyInfo { required string Name = 1; required int64 Duration = 2;