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: archive dir error #729

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

andyzhangx
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
fix: archive dir error

from below error msg, os.Rename is not a sync call, unmount will be called before os.Rename is complete, therefore the os.Rename would fail finally, this PR adds a 2s second before unmount to make sure os.Rename could be completed

[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.770987       1 utils.go:109] GRPC call: /csi.v1.Controller/DeleteVolume
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.771001       1 utils.go:110] GRPC request: {"secrets":"***stripped***","volume_id":"nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive"}
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.771043       1 controllerserver.go:218] DeleteVolume: found mountOptions(nfsvers=4.1) for volume(nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive)
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.771051       1 controllerserver.go:465] internally mounting nfs-server.default.svc.cluster.local:/ at /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.771120       1 nodeserver.go:132] NodePublishVolume: volumeID(nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive) source(nfs-server.default.svc.cluster.local:/) targetPath(/tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6) mountflags([nfsvers=4.1])
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.771137       1 mount_linux.go:218] Mounting cmd (mount) with arguments (-t nfs -o nfsvers=4.1 nfs-server.default.svc.cluster.local:/ /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6)
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.789318       1 nodeserver.go:149] skip chmod on targetPath(/tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6) since mountPermissions is set as 0
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.789338       1 nodeserver.go:151] volume(nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive) mount nfs-server.default.svc.cluster.local:/ on /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6 succeeded
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.789353       1 controllerserver.go:256] archiving subdirectory /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6 --> /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/archived-pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.793519       1 controllerserver.go:480] internally unmounting /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.793536       1 nodeserver.go:172] NodeUnpublishVolume: unmounting volume nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive on /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.793543       1 nodeserver.go:177] force unmount nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive on /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.793663       1 mount_helper_common.go:56] unmounting "/tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6" (corruptedMount: false, mounterCanSkipMountPointChecks: true)
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.793680       1 mount_linux.go:789] Unmounting /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.816473       1 mount_helper_common.go:150] Deleting path "/tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6"
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] I0807 01:47:25.816538       1 nodeserver.go:185] NodeUnpublishVolume: unmount volume nfs-server.default.svc.cluster.local##pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6##archive on /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6 successfully
[pod/csi-nfs-controller-76c9866697-gbwgk/nfs] E0807 01:47:25.816553       1 utils.go:114] GRPC error: rpc error: code = Internal desc = archive subdirectory(/tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6, /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/archived-pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6) failed with rename /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6 /tmp/pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6/archived-pvc-0ad8fba9-dcb2-4106-8887-c4968eb3afd6: no such file or directory

Which issue(s) this PR fixes:

Fixes #595

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix: archive dir error

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 7, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 7, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10287049104

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 78.831%

Totals Coverage Status
Change from base Build 10280312227: 0.04%
Covered Lines: 890
Relevant Lines: 1129

💛 - Coveralls

@andyzhangx
Copy link
Member Author

/retest

2 similar comments
@andyzhangx
Copy link
Member Author

/retest

@andyzhangx
Copy link
Member Author

/retest

@andyzhangx andyzhangx merged commit 2524d92 into kubernetes-csi:master Aug 8, 2024
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VolumeFailedDelete, when i deleted pvc but pv wasn't deleted
3 participants