sortbitwise是什么意思

问题

flag sortbitwise 在ceph中是什么意思,在Jewel版本下可以看到多了这个flags

1
2
3
4
5
6
7
8
9
10
11
[root@lab8106 current]# ceph -s
cluster ffe7a8db-c671-4b45-a784-ddb41e633905
health HEALTH_OK
monmap e1: 1 mons at {lab8106=192.168.8.106:6789/0}
election epoch 4, quorum 0 lab8106
fsmap e4: 1/1/1 up {0=lab8106=up:active}
osdmap e132: 8 osds: 8 up, 8 in
flags sortbitwise
pgmap v206294: 201 pgs, 5 pools, 4684 MB data, 1214 objects
9669 MB used, 2216 GB / 2226 GB avail
201 active+clean

找到的相关资料

After upgrading, users should set the ‘sortbitwise’ flag to enable the new internal object sort order: ceph osd set sortbitwise
This flag is important for the new object enumeration API and for new backends like BlueStore.

From Ceph release notes

commit 383185bfbae74797cdb44f50b4bf651422800ff1

Author: Sage Weil sage@redhat.com

Date: Fri Aug 7 16:14:09 2015 -0400

mon/OSDMonitor: osd set/unset sortbitwise

Add monitor command to flip the switch on the OSD hobject_t sort

order.

From git

第一次在源码中出现:

commit 138f58493715e386929f152424b70df37843541b

Author: John Spray john.spray@redhat.com

Date: Mon Aug 17 14:40:46 2015 -0400

osdc/Objecter: new-style pgls

Signed-off-by: John Spray john.spray@redhat.com

Signed-off-by: Sage Weil sage@redhat.com

From git

Related github issue: https://github.com/ceph/ceph/pull/4919/commits

初步结论: sortbitwise 内部排序算法的一个变化.之所以暴露出来是因为要兼容一些pre-jewel版本.在新的版本中应该保持开启状态.

以上转载自博客:What ‘sortbitwise’ flag means in Ceph?

红帽的官方回答

  • 如果你使用dev版本Infernalis或仍在开发中的LTS版本的Ceph的Jewel版本,你会看到这个标志在ceph状态输出默认启用
  • 这个标志sortbitwise在Infernalis版本中引入
  • 这个标志是在这个版本提交的upstream commit 968261b11ac30622c0606d1e2ddf422009e7d330

下载ceph的源码,进入源码目录

1
2
3
4
5
6
7
8
9
10
11
[root@lab8106 all]# git show 968261b11ac30622c0606d1e2ddf422009e7d330
commit 968261b11ac30622c0606d1e2ddf422009e7d330
Author: Sage Weil <sage@redhat.com>
Date: Fri Aug 7 16:01:12 2015 -0400

osd/OSDMap: add a SORTBITWISE OSDMap flag

This flag will indicate that hobject_t's shall hence-forth be
sorted in a bitwise fashion.

Signed-off-by: Sage Weil <sage@redhat.com>

正如我们在上面给定的提交的描述中所说,该标志将表明hobject_t的将以 bitwise fashion方式排序。
现在意味着现在的对象将在OSDs中以按位方式排序,并且此标志默认在Infernalis和Jewel发布版本中启用。

总结

目前来看这个是底层的一个排序的算法的变动,对上层目前还不清楚是有什么可以可见的变化,总之,这个让它默认开启就行,不要去修改它就可以了

变更记录

Why Who When
创建 武汉-运维-磨渣 2017-01-12