Bug #9644
closedceph-disk not playing nice with test/erasure-code/test-erasure-code.sh
0%
Description
I haven't seen anyone complaining about this so either 1) no one is running this test, or 2) I'm the only one hitting for some reason I haven't figured out yet. I'm willing to go with the latter because test/erasure-code/test-erasure-code.sh is run during 'make check'.
State of affairs: branch based off of 5c2984e6e155026699c2ed1df8b08b7a33f56e9b, at some point 'test-erasure-code.sh' will call ceph-disk to activate an osd:
run_osd: 49: CEPH_ARGS='--fsid=160f8104-ea22-4888-abcd-c2d0780743e3 --auth-supported=none --mon-host=127.0.0.1 --osd-journal-size=100 --osd-data=test-erasure-code/0 --chdir= --osd-pool-default-erasure-code-directory=.libs --run-dir=test-erasure-code --debug-osd=20 --log-file=test-erasure-code/osd-$id.log --pid-file=test-erasure-code/osd-$id.pidfile ' run_osd: 49: ./ceph-disk --statedir=test-erasure-code --sysconfdir=test-erasure-code --prepend-to-path= --verbose activate --mark-init=none test-erasure-code/0 DEBUG:ceph-disk:Cluster uuid is 160f8104-ea22-4888-abcd-c2d0780743e3 INFO:ceph-disk:Running command: ceph-osd --cluster=ceph --show-config-value=fsid DEBUG:ceph-disk:Cluster name is ceph DEBUG:ceph-disk:OSD uuid is e9ff4bec-c644-4340-a055-25f7e39c97a4 DEBUG:ceph-disk:Allocating OSD id... INFO:ceph-disk:Running command: ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring osd create --concise e9ff4bec-c644-4340-a055-25f7e39c97a4
See above how we have specified to ceph-disk '--statedir=test-erasure-code' and yet it is trying to find the keyring in '/var/lib/ceph'.
After looking into the code I found that the variable from which the keyring location is read has been populated during argument parsing, using the global variable STATEDIR as basis. At that time, STATEDIR still has its default value (/var/lib/ceph), only being changed later in the game to whatever is supplied to '--statedir'.
AFAICT there were no changes in the code that would lead to this all of a sudden. And as I am apparently the one and only hitting this I can't but wonder whether this is a red herring.
Feedback would be appreciated.