]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: write object store's meta sequentially. 43652/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 25 Oct 2021 12:30:39 +0000 (12:30 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 25 Oct 2021 13:18:15 +0000 (13:18 +0000)
commitb3b35dba971e74a39522ec1b242750e5eeb16736
tree3d7196da89b476ed2cbbee031e5a65d03db77f91
parent8ca0012e47ee3a2092320b30b8ea10a896bb6561
crimson/osd: write object store's meta sequentially.

We're violating the contract on `ObjectStore::write_meta()' that
requires the method must be called in one-by-one manner.
For instance, the implementation in `BlueStore` does read-modify-
write without any locking. Having multiple in-flight requests
the same time (can happen b/c of the thread pool in `AlienStore`)
may lead to a corruption like the following one:

```
[2021-10-25 13:38:38,725][ceph_volume.process][INFO  ] Running command: /home/rzarz/dev/ceph1/build/bin/ceph-bluestore-tool show-label --dev /dev/nvme0n1p3
[2021-10-25 13:38:38,737][ceph_volume.process][INFO  ] stdout {
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "/dev/nvme0n1p3": {
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "osd_uuid": "a11030f3-f41f-482c-916c-98476feaf25f",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "size": 1022903713792,
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "btime": "2021-10-25T12:41:11.938439+0200",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "description": "main",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "bfm_blocks": "249732352",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "bfm_blocks_per_key": "128",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "bfm_bytes_per_block": "4096",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "bfm_size": "1022903713792",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "bluefs": "1",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "ceph_fsid": "f884fe47-b307-46f9-b021-320d7c5a427b",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "kv_backend": "rocksdb",
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout "mkfs_done": "yes"
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout }
[2021-10-25 13:38:38,738][ceph_volume.process][INFO  ] stdout }
[2021-10-25 13:38:38,738][ceph_volume.devices.raw.list][ERROR ] device /dev/nvme0n1p3 does not have all BlueStore data needed to be a valid OSD: ['{', '    "/dev/nvme0n1p3": {', '        "osd_uuid": "a11030f3-f41f-482c-916c-98476feaf25f",', '        "size": 1022903713792,', '        "btime": "2021-10-25T12:41:11.938439+0200",', '        "description": "main",', '        "bfm_blocks": "249732352",', '        "bfm_blocks_per_key": "128",', '        "bfm_bytes_per_block": "4096",', '        "bfm_size": "1022903713792",', '        "bluefs": "1",', '        "ceph_fsid": "f884fe47-b307-46f9-b021-320d7c5a427b",', '        "kv_backend": "rocksdb",', '        "mkfs_done": "yes"', '    }', '}']
'whoami'
[2021-10-25 13:38:38,738][ceph_volume.devices.raw.list][INFO  ] device /dev/nvme0n1p3 does not have BlueStore information
```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit 92b2fe955f9cafdf6a9c6adb8eadc5f6a9fb9b8b)
src/crimson/osd/osd.cc