* [PATCH] mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf
@ 2010-06-29 14:29 CC Lien
2010-06-29 15:37 ` Sage Weil
0 siblings, 1 reply; 2+ messages in thread
From: CC Lien @ 2010-06-29 14:29 UTC (permalink / raw)
To: ceph-devel
Hi
I got a trouble that mkcephfs will have wrong "maxosd" when you have
ceph.conf with OSD ids in random order like:
[osd2]
...
[osd0]
...
[osd1]
...
In this case, you will got "2" for the "maxosd", instead of 3.
After adding a sort, the problem seems solved.
Cheers,
CC Lien
Signed-off-by: CC Lien <cc_lien@tcloudcomputing.com>
---
src/mkcephfs.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mkcephfs.in b/src/mkcephfs.in
index 2edaad1..3cad4cf 100644
--- a/src/mkcephfs.in
+++ b/src/mkcephfs.in
@@ -110,7 +110,7 @@ if echo $what | grep -q mon0 ; then
# build osdmap
osdmap="/tmp/osdmap.$$"
if [ -z "$numosd" ]; then
- maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | tail -1 | cut -c 4-`
+ maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | cut -c 4- | sort
-n | tail -1`
numosd=$(($maxosd + 1))
echo max osd in $conf is $maxosd, num osd is $numosd
fi
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf
2010-06-29 14:29 [PATCH] mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf CC Lien
@ 2010-06-29 15:37 ` Sage Weil
0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2010-06-29 15:37 UTC (permalink / raw)
To: CC Lien; +Cc: ceph-devel
Applied, thanks!
sage
On Tue, 29 Jun 2010, CC Lien wrote:
> Hi
>
> I got a trouble that mkcephfs will have wrong "maxosd" when you have
> ceph.conf with OSD ids in random order like:
>
> [osd2]
> ...
> [osd0]
> ...
> [osd1]
> ...
>
> In this case, you will got "2" for the "maxosd", instead of 3.
> After adding a sort, the problem seems solved.
>
>
> Cheers,
> CC Lien
>
> Signed-off-by: CC Lien <cc_lien@tcloudcomputing.com>
> ---
> src/mkcephfs.in | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/mkcephfs.in b/src/mkcephfs.in
> index 2edaad1..3cad4cf 100644
> --- a/src/mkcephfs.in
> +++ b/src/mkcephfs.in
> @@ -110,7 +110,7 @@ if echo $what | grep -q mon0 ; then
> # build osdmap
> osdmap="/tmp/osdmap.$$"
> if [ -z "$numosd" ]; then
> - maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | tail -1 | cut -c 4-`
> + maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | cut -c 4- | sort
> -n | tail -1`
> numosd=$(($maxosd + 1))
> echo max osd in $conf is $maxosd, num osd is $numosd
> fi
> --
> 1.7.0.4
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-29 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29 14:29 [PATCH] mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf CC Lien
2010-06-29 15:37 ` Sage Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).