refactor: remove not worked metasrv option#217
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the non-functional --use-memory-store option from metasrv, including all related code, configuration, and CLI flags.
- Removed the
useMemoryMetaparameter and associated logic from metasrv component - Made Etcd configuration optional by removing the required validation tag
- Replaced the
useMemoryMetaboolean check with a nil check on the Etcd configuration - Removed the
--use-memory-metaCLI flag from cluster create command
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/config/baremetal.go | Removed validate:"required" tag from Etcd field to make it optional |
| pkg/components/metasrv.go | Removed useMemoryMeta parameter from NewMetaSrv and eliminated logic that generated --use-memory-store argument |
| pkg/cluster/baremetal/cluster.go | Removed useMemoryMeta field from Cluster struct, deleted WithMetastore option function, and updated NewClusterComponents signature |
| pkg/cluster/baremetal/create.go | Changed conditional from !c.useMemoryMeta to c.config.Etcd != nil to determine whether to create Etcd cluster |
| cmd/gtctl/cluster_create.go | Removed UseMemoryMeta field and --use-memory-meta CLI flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #217 +/- ##
============================================
- Coverage 37.65% 20.93% -16.72%
============================================
Files 16 35 +19
Lines 1304 1949 +645
============================================
- Hits 491 408 -83
- Misses 708 1434 +726
- Partials 105 107 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2. fix golangci-lint 3. upgrade go version 4. use bare metal in e2e test
ff4233f to
172f08b
Compare
|
|
||
| func MustClose(c io.Closer) { | ||
| if err := c.Close(); err != nil { | ||
| _ = fmt.Errorf("failed to close: %v", err) |
There was a problem hiding this comment.
What is the meaning of this place? If you want to print the error log, please refer to: https://github.com/GreptimeTeam/gtctl/blob/172f08b328724bdb132fb152dbd74e15dc71b2da/cmd/gtctl/cluster_create.go\#L207
|
|
||
| func RemoveAll(path string) { | ||
| if err := os.RemoveAll(path); err != nil { | ||
| _ = fmt.Errorf("failed to remove path %s: %v", path, err) |
the
--use-memory-storeis not worked in metasrv