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

glusterfs service: Ensure dirs needed by glusterfind exist #29071

Merged
merged 4 commits into from Sep 9, 2017

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Sep 7, 2017

Motivation for this change

Without these dirs, glusterfind errors like this:

# glusterfind create test1 myvol
Failed to copy public key to /var/lib/glusterd/glusterfind/.keys: [Errno 2] No such file or directory: '/var/lib/glusterd/glusterfind/.keys/test1_myvol_secret.pem.pub'
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

FYI @bachp who's another user of this service.


I would also like to have this change in 17.09, please let me know if I need to open a separate PR for that.

@mention-bot
Copy link

@nh2, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bachp to be a potential reviewer.

@nh2
Copy link
Contributor Author

nh2 commented Sep 8, 2017

Don't merge yet, I have at least 2 more fixes to glusterfind coming.

Fixes error

  File "/nix/store/lxpsl84km87xpk59nai6a33ihgpfs7qr-glusterfs-3.10.2/libexec/glusterfs/glusterfind/changelog.py", line 105, in populate_pgfid_and_inodegfid
      file_xattrs = xattr.list(p)
  AttributeError: 'module' object has no attribute 'list'

when using `glusterfind pre`.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1489610

Also add patch to correctly log stderr from remote nodes
when glusterfind fails.
This, too, should be removed when fixed upstream.
This fixes:

  Traceback (most recent call last):
    File "/nix/store/7f9arl3f9xyj8sm05mkanh2mlp217192-glusterfs-3.10.2/libexec/glusterfs/glusterfind/changelog.py", line 22, in <module>
      import libgfchangelog
    File "/nix/store/7f9arl3f9xyj8sm05mkanh2mlp217192-glusterfs-3.10.2/libexec/glusterfs/glusterfind/libgfchangelog.py", line 21, in <module>
      libgfc = CDLL("libgfchangelog.so", use_errno=True, mode=RTLD_GLOBAL)
    File "/nix/store/nlyr5ankhi7yvva8zndi718zj37js270-python-2.7.13-env/lib/python2.7/ctypes/__init__.py", line 362, in __init__
      self._handle = _dlopen(self._name, mode)
  OSError: libgfchangelog.so: cannot open shared object file: No such file or directory
  Connection to 10.0.0.2 closed.

when running `glusterfind pre`.

Done by setting PYTHONPATH/LD_LIBRARY_PATH as for the other
Python scripts.
@nh2
Copy link
Contributor Author

nh2 commented Sep 8, 2017

I've pushed 3 more fixes. glusterfind pre, post, list, and query now work for me.

CC @bachp

OK to merge again from my side.

@nh2 nh2 mentioned this pull request Sep 8, 2017
8 tasks
@bachp
Copy link
Member

bachp commented Sep 9, 2017

I applied the patch to my setup and everything is working.
So from my point of view this is good to merge.

@joachifm joachifm merged commit b5163bc into NixOS:master Sep 9, 2017
@joachifm
Copy link
Contributor

joachifm commented Sep 9, 2017

@nh2 you can open a PR with cherry-picked commits against release-17.09 if you like. I can also do the cherry-picks directly if you prefer, but pushing the green button is less work for me :)

@nh2
Copy link
Contributor Author

nh2 commented Sep 9, 2017

@joachifm Thanks! Cherry-pick PR at #29160.

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.

None yet

4 participants