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

systemd: set up environment in rbdmap unit file #8222

Merged
merged 4 commits into from Mar 23, 2016
Merged

Conversation

smithfarm
Copy link
Contributor

http://tracker.ceph.com/issues/14984 Fixes: #14984

Signed-off-by: Nathan Cutler ncutler@suse.com

@smithfarm smithfarm added this to the jewel milestone Mar 19, 2016
@smithfarm
Copy link
Contributor Author

The bug report says "/usr/bin/rbdmap requires the RBDMAPFILE variable to be set," which doesn't sound right. Shouldn't the code default to a sensible value if the environment variable is not set?

@smithfarm
Copy link
Contributor Author

@tchaikov @BRANTO1 Your thoughts?

Signed-off-by: Nathan Cutler <ncutler@suse.com>
Since init-rbdmap is sysvinit-specific, tagging log lines "init-rbdmap" is
potentially misleading.

In systemd- and upstart-based systems, /usr/bin/rbdmap is run directly.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
@smithfarm
Copy link
Contributor Author

I looked in qa/workunits/ but did not see any obvious evidence that tests are exercising rbdmap. Anyone know which suite I should run to test this?

@smithfarm smithfarm changed the title systemd: add Environment to rbdmap.service systemd: setup environment in rbdmap unit file Mar 19, 2016
@smithfarm smithfarm changed the title systemd: setup environment in rbdmap unit file systemd: set up environment in rbdmap unit file Mar 20, 2016
@smithfarm
Copy link
Contributor Author

Spawning a cluster for manual testing with: cw ceph-qa-suite --simultaneous-jobs 9 --verbose --teuthology-git-url http://github.com/dachary/teuthology --teuthology-branch openstack --ceph-qa-suite-git-url http://github.com/dachary/ceph-qa-suite --suite-branch wip-ceph-disk --ceph-git-url http://github.com/SUSE/ceph --ceph wip-14984 --suite ceph-disk --filter centos_7

(See #8228 for an explanation of how this works.)

@smithfarm
Copy link
Contributor Author

Scope of test: on the cluster deployed with packages built from this PR, run systemctl start rbdmap.service and inspect the logs for bogus messages. Confirm there are none. Add set -x to /usr/bin/rbdmap and restart the service. Confirm via journalctl that the /etc/ceph/rbdmap file is processed. Then, back out the changes and restart the service again - confirm that bogus messages appear in the log and /etc/ceph/rbdmap file is not processed.

The test did not include creating an RBD image or using rbdmap to map it to a device and mount it.

Test result: passed

@smithfarm smithfarm force-pushed the wip-14984 branch 4 times, most recently from 3fdf1f7 to 62ad0c3 Compare March 20, 2016 21:48
Before a7a3658 the rbdmap script was logging bogus messages and not working
on systemd platforms because the unit file was not defining the RBDMAPFILE
environment variable.

This workunit asserts that the bug has been fixed.

http://tracker.ceph.com/issues/14984 References: ceph#14984

Signed-off-by: Nathan Cutler <ncutler@suse.com>
@smithfarm
Copy link
Contributor Author

Cherry-picked 0effb9e (the commit containing the new workunit) to jewel-wip-workunit branch based on jewel.

Running the workunit as a standalone test against this modified jewel branch to demonstrate that the workunit fails (for the right reason) when the bug is present.

failed for the right reason http://149.202.177.104:8081/ubuntu-2016-03-20_23:45:18-rbd:singleton:all:rbdmap_RBDMAPFILE.yaml-jewel-wip-workunit---basic-openstack/

2016-03-21T00:43:41.510 INFO:tasks.workunit.client.0.target149202177065.stdout:TEST: assert that rbdmap has not logged anything since TIMESTAMP
2016-03-21T00:43:41.511 INFO:tasks.workunit.client.0.target149202177065.stderr:+ echo 'TEST: assert that rbdmap has not logged anything since TIMESTAMP'
2016-03-21T00:43:41.511 INFO:tasks.workunit.client.0.target149202177065.stderr:+ grep 'rbdmap\[[[:digit:]]'
2016-03-21T00:43:41.511 INFO:tasks.workunit.client.0.target149202177065.stderr:+ journalctl --since '2016-03-21 00:43:41' -t rbdmap
2016-03-21T00:43:41.513 INFO:tasks.workunit.client.0.target149202177065.stderr:+ journalctl --since '2016-03-21 00:43:41' -t init-rbdmap
2016-03-21T00:43:41.514 INFO:tasks.workunit.client.0.target149202177065.stderr:+ grep 'rbdmap\[[[:digit:]]'
2016-03-21T00:43:41.515 INFO:tasks.workunit.client.0.target149202177065.stdout:Mar 21 00:43:41 target149202177065.teuthology init-rbdmap[16871]: No  found.
2016-03-21T00:43:41.516 INFO:tasks.workunit.client.0.target149202177065.stderr:+ exit 1
2016-03-21T00:43:41.516 DEBUG:paramiko.transport:[chan 38] EOF received (38)
2016-03-21T00:43:41.517 INFO:tasks.workunit:Stopping ['rbd/test_rbdmap_RBDMAPFILE.sh'] on client.0...

Command used: cw ceph-qa-suite --simultaneous-jobs 9 --verbose --teuthology-git-url http://github.com/dachary/teuthology --teuthology-branch openstack --ceph-qa-suite-git-url http://github.com/smithfarm/ceph-qa-suite --suite-branch wip-14984 --ceph-git-url https://github.com/SUSE/ceph --ceph jewel-wip-workunit --suite rbd/singleton/all/rbdmap_RBDMAPFILE.yaml distros/all/centos_7.2.yaml

@smithfarm
Copy link
Contributor Author

Running the workunit as a standalone test against this PR to validate the bugfix.

pass http://149.202.177.104:8081/ubuntu-2016-03-21_05:50:38-rbd:singleton:all:rbdmap_RBDMAPFILE.yaml-wip-14984---basic-openstack/

2016-03-21 06:49:09,277.277 INFO:tasks.workunit.client.0.target149202181028.stdout:TEST: assert that rbdmap has not logged anything since TIMESTAMP
2016-03-21 06:49:09,278.278 INFO:tasks.workunit.client.0.target149202181028.stderr:+ echo 'TEST: assert that rbdmap has not logged anything since TIMESTAMP'
2016-03-21 06:49:09,278.278 INFO:tasks.workunit.client.0.target149202181028.stderr:+ journalctl --since '2016-03-21 06:49:09' -t rbdmap
2016-03-21 06:49:09,279.279 INFO:tasks.workunit.client.0.target149202181028.stderr:+ grep 'rbdmap\[[[:digit:]]'
2016-03-21 06:49:09,279.279 INFO:tasks.workunit.client.0.target149202181028.stderr:+ journalctl --since '2016-03-21 06:49:09' -t init-rbdmap
2016-03-21 06:49:09,280.280 INFO:tasks.workunit.client.0.target149202181028.stderr:+ grep 'rbdmap\[[[:digit:]]'
2016-03-21 06:49:09,281.281 DEBUG:paramiko.transport:[chan 38] EOF received (38)
2016-03-21 06:49:09,282.282 INFO:tasks.workunit.client.0.target149202181028.stderr:+ exit 0
...
2016-03-21 06:49:57,152.152 INFO:teuthology.run:Summary data:
{description: 'rbd:singleton:all:rbdmap_RBDMAPFILE.yaml', duration: 597.1750349998474,
  flavor: basic, owner: scheduled_ubuntu@teuthology, success: true}

cw ceph-qa-suite --simultaneous-jobs 9 --verbose --teuthology-git-url http://github.com/dachary/teuthology --teuthology-branch openstack --ceph-qa-suite-git-url http://github.com/smithfarm/ceph-qa-suite --suite-branch wip-14984 --ceph-git-url https://github.com/SUSE/ceph --ceph wip-14984 --suite rbd/singleton/all/rbdmap_RBDMAPFILE.yaml distros/all/centos_7.2.yaml

@smithfarm
Copy link
Contributor Author

Associated ceph/ceph-qa-suite PR: ceph/ceph-qa-suite#902

# that require processing.
#
set -ex

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here we could add a packaging test that would check which rbdmap (just to verify that the shell script is packaged)

@b-ranto
Copy link
Contributor

b-ranto commented Mar 23, 2016

lgtm

@smithfarm
Copy link
Contributor Author

@BRANTO1 Thanks for the review! Could you take a look at #8224 as well?

@liewegas liewegas merged commit df6570c into ceph:master Mar 23, 2016
@smithfarm smithfarm deleted the wip-14984 branch March 23, 2016 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants