swift-get-nodes devices setting in config files

Bug #907908 reported by Ben Hartshorne
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
Kun Huang

Bug Description

The output of swift-get-nodes does not honor the devices settings in account, container, and object config files.
* I set 'devices=/srv/swift-storage/' (the default is /srv/node), then ran swift-get-nodes.
* The output contains 'ssh 10.0.0.249 "ls -lah /srv/node/sdag1/containers/56319/f5c/dbff743f38ec090aaad93c4da3666f5c/"'.
This command clearly won't work since my devices are not mounted at /srv/node/.

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

See also bug 885006, maybe a common root cause.

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

This looks unfixable. I toyed with an idea of lifting the "devices=" setting from /etc/swift/{*/}*.conf, but the problem is how to identify the right config. Also, remote ones can be different from local ones. Seems like too much trouble to overcome this problem.

Pete Zaitcev (zaitcev)
Changed in swift:
status: New → Confirmed
Changed in swift:
importance: Undecided → Low
Changed in swift:
assignee: nobody → Kun Huang (academicgareth)
Revision history for this message
Kun Huang (academicgareth) wrote :

Let me make a conclusion:
1, The core problem is how we know where is the device? swift's default setting is /srv/node, but the real usage is not, SAIO is good sample. How do we get the devices is our problem.
2, The devices is set in every main server config file, in another word, it could be different. If we want to know location of device, we should read config file which is used as the first argument of running server. But the purpose of this command "swift-get-nodes" should work without servers running, it read the ring data from ring.gz which is serialized in runtime. So finding using config file is not stable.
3, Another solution is save device_location into ring. =,= That'll be a big change...but device location itself is meaningless compared with other data because device location only describes the relative path in linux system, not data itself.
4, Compared with apache, swift has many independent servers which use their own config, even contain same thing. If we want to maintain that kind of data, it's hard. The example is /etc/swift/swift.conf.

As a result, current swift can't help us solve this issue. That's "unfixable" I understand. So I restate it to "won't fix"

Revision history for this message
Ben Hartshorne (6-launchpad-green-hartshorne-net) wrote :

I think it's fair to say that most people use some form of configuration management to keep the nodes within a cluster consistent, so assuming that a remote host will have a similar config to the current host is reasonable.

If you really don't want to use the values in the local config, please change the output so that it doesn't appear to be a copy/pastable command; instead use natural language eg "The object is in containers/56319/f5c/dbff743f38ec090aaad93c4da3666f5c/ on 10.0.0.123".

Creating a command that is clearly intended to be copied to the shell that hard codes a configurable element just seems like it's teasing. The output transparently mixes accurate information (the host and path within the container) with information it has no right to assume is correct (the absolute path to the container directory). This mix is not indicated in any way and is a trap.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23951

Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/23951
Committed: http://github.com/openstack/swift/commit/cb69dc881a44e200b2abef9d8e30ded0f2a0aa99
Submitter: Jenkins
Branch: master

commit cb69dc881a44e200b2abef9d8e30ded0f2a0aa99
Author: Kun Huang <email address hidden>
Date: Sat Mar 9 03:13:18 2013 +0800

    Give friendly notification in swift-get-nodes

    Hard coding of '/srv/node' maybe drive to some errors. But it seems
    unfixable (please see talks in bug report). To avoid erros as we can,
    showing a friendly notification to let user set their own device
    location works better than hard coding directly.

    Change-Id: I45d749dd52af8d3b051dfe98dbb9d71a5a374f97
    Fixes: bug #907908

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.8.0-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in swift:
milestone: 1.8.0-rc1 → 1.8.0
Revision history for this message
beshoy (beshoy-mekhail) wrote :

thanks, is there is no a method to change the default directory /srv/node ?!
i test it but i get error "[Errno 2] No such file or directory: '/srv/node' "
so now i can not change it but i will try
thanks again everybody

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.