Skip to content

Commit 2d1fd03

Browse files
committed
Revert "fix(store): remove pg_num reconfiguration"
This reverts commit 39a5e7f.
1 parent 16c3388 commit 2d1fd03

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

store/gateway/bin/boot

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,38 @@ until confd -onetime -node $ETCD -config-file /app/confd.toml >/dev/null 2>/dev/
3030
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
3131
done
3232

33+
# set the number of placement groups for the default pools - they come up with defaults that are too low
34+
if ! etcdctl --no-sync -C $ETCD get /deis/store/defaultPoolsConfigured >/dev/null 2>&1 ; then
35+
echo "store-gateway: setting pg_num values for default pools..."
36+
function set_until_success {
37+
set +e
38+
ceph osd pool set $1 pg_num $2 2>/dev/null
39+
PG_SET=$?
40+
until [[ $PG_SET -eq 0 ]]; do
41+
sleep 5
42+
ceph osd pool set $1 pg_num $2 2>/dev/null
43+
PG_SET=$?
44+
done
45+
46+
ceph osd pool set $1 pgp_num $2 2>/dev/null
47+
PGP_SET=$?
48+
until [[ $PGP_SET -eq 0 ]]; do
49+
sleep 5
50+
ceph osd pool set $1 pgp_num $2 2>/dev/null
51+
PGP_SET=$?
52+
done
53+
set -e
54+
}
55+
56+
PG_NUM=`etcdctl --no-sync -C $ETCD get /deis/store/pgNum`
57+
58+
set_until_success data ${PG_NUM}
59+
set_until_success rbd ${PG_NUM}
60+
set_until_success metadata ${PG_NUM}
61+
62+
etcdctl --no-sync -C $ETCD set /deis/store/defaultPoolsConfigured youBetcha >/dev/null
63+
fi
64+
3365
# we generate a key for the gateway. we can do this because we have the client key templated out
3466
if ! etcdctl --no-sync -C $ETCD get /deis/store/gatewayKeyring >/dev/null 2>&1 ; then
3567
ceph-authtool --create-keyring /etc/ceph/ceph.client.radosgw.keyring
@@ -97,4 +129,4 @@ if [[ ! -z $EXTERNAL_PORT ]]; then
97129

98130
fi
99131

100-
wait
132+
wait

store/tests/store_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ func TestStore(t *testing.T) {
2525
// prep etcd with the monitor hostname -- this is done in an ExecStartPre in the monitor unit
2626
etcdutils.SetSingle(t, "/deis/store/hosts/"+host, hostname, etcdPort)
2727

28+
// since we're only running one OSD, our default of 128 placement groups is too large
29+
etcdutils.SetSingle(t, "/deis/store/pgNum", "64", etcdPort)
30+
2831
// test deis-store-monitor
2932
fmt.Printf("--- Run deis/store-monitor:%s at %s\n", tag, host)
3033
name := "deis-store-monitor-" + tag

tests/mock/mock.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func RunMockCeph(t *testing.T, name string, cli *client.DockerCli, etcdPort stri
5858

5959
etcdutils.SetSingle(t, "/deis/store/hosts/"+utils.HostAddress(), utils.HostAddress(), etcdPort)
6060

61+
// since we're only running one OSD, our default of 128 placement groups is too large
62+
etcdutils.SetSingle(t, "/deis/store/pgNum", "64", etcdPort)
63+
6164
monitorName := name + "-monitor"
6265
RunMockCephMonitor(t, monitorName, etcdPort)
6366

0 commit comments

Comments
 (0)