Skip to content

refactor: remove not worked metasrv option#217

Open
MichaelScofield wants to merge 1 commit into
developfrom
remove-not-worked-metasrv-option
Open

refactor: remove not worked metasrv option#217
MichaelScofield wants to merge 1 commit into
developfrom
remove-not-worked-metasrv-option

Conversation

@MichaelScofield
Copy link
Copy Markdown
Contributor

the --use-memory-store is not worked in metasrv

@MichaelScofield MichaelScofield changed the title remove not worked metasrv option refactor!: remove not worked metasrv option Dec 19, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useMemoryMeta parameter and associated logic from metasrv component
  • Made Etcd configuration optional by removing the required validation tag
  • Replaced the useMemoryMeta boolean check with a nil check on the Etcd configuration
  • Removed the --use-memory-meta CLI 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.

@MichaelScofield MichaelScofield changed the title refactor!: remove not worked metasrv option refactor: remove not worked metasrv option Dec 19, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 36.84211% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.93%. Comparing base (88d4486) to head (cf66ffc).

Files with missing lines Patch % Lines
pkg/utils/file/file.go 33.33% 4 Missing and 2 partials ⚠️
pkg/cluster/baremetal/cluster.go 0.00% 3 Missing ⚠️
pkg/cluster/baremetal/create.go 0.00% 1 Missing ⚠️
pkg/components/metasrv.go 0.00% 1 Missing ⚠️
pkg/kube/client.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

2. fix golangci-lint
3. upgrade go version
4. use bare metal in e2e test
@MichaelScofield MichaelScofield force-pushed the remove-not-worked-metasrv-option branch from ff4233f to 172f08b Compare December 19, 2025 11:59
Comment thread pkg/utils/file/file.go

func MustClose(c io.Closer) {
if err := c.Close(); err != nil {
_ = fmt.Errorf("failed to close: %v", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread pkg/utils/file/file.go

func RemoveAll(path string) {
if err := os.RemoveAll(path); err != nil {
_ = fmt.Errorf("failed to remove path %s: %v", path, err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ddtio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants