Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for etcd snapshot on windows #5800

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

jonstelly
Copy link
Contributor

@jonstelly jonstelly commented Jun 24, 2022

Pull Request

What? (description)

Fix talosctl etcd snapshot on windows. Before PR change, executing ./talosctl.exe etcd snapshot ./etcd.db on windows would give me:

error renaming to final location: rename ./etcd.db.part ./etcd.db: The process cannot access the file because it is being used by another process.

Why? (reasoning)

Standard windows file locking issue, dest not being closed before trying to re-open it for the os.Rename().

Acceptance

I didn't quite get my environment all the way set up, make conformance and make unit-tests isn't running locally, but I did build talosctl with my change and verify it fixed my issue and generated an etcd snapshot.

Please use the following checklist:

  • you linked an issue (if applicable)
  • you included tests (if applicable)
  • you ran conformance (make conformance)
  • you formatted your code (make fmt)
  • you linted your code (make lint)
  • you generated documentation (make docs)
  • you ran unit-tests (make unit-tests)

See make help for a description of the available targets.


This change is Reviewable

@smira smira added this to the v1.2 milestone Jun 24, 2022
@smira
Copy link
Member

smira commented Jun 24, 2022

could you please fix your commit message to include the DCO?

git commit --amend -s

and make it something like: fix: etcd snapshot command on Windows with some non-empty commit body?

@smira
Copy link
Member

smira commented Jun 24, 2022

/ok-to-test

Close file before renaming

Signed-off-by: Jon Stelly <967068+jonstelly@users.noreply.github.com>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
@smira
Copy link
Member

smira commented Oct 28, 2022

/m

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.

3 participants