Skip to content

Commit 44e5c3e

Browse files
add -1 storage id for failed devices
1 parent cab0710 commit 44e5c3e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

env_var

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SIMPLY_BLOCK_COMMAND_NAME=sbcli-alsh
2-
SIMPLY_BLOCK_VERSION=5.2.7
1+
SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
2+
SIMPLY_BLOCK_VERSION=5.2.8
33

44
SIMPLY_BLOCK_DOCKER_IMAGE=simplyblock/simplyblock:main
55
DOCKER_USER=hamdysimplyblock

simplyblock_core/controllers/device_controller.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def device_set_state(device_id, state):
4242
device.status = state
4343
snode.write_to_db(db_controller.kv_store)
4444

45+
distr_controller.send_cluster_map_to_node(snode)
46+
4547
if state == NVMeDevice.STATUS_ONLINE:
4648
snode = db_controller.get_storage_node_by_id(dev.node_id)
4749
logger.info("Make other nodes connect to the node devices")
@@ -53,8 +55,8 @@ def device_set_state(device_id, state):
5355
if node.enable_ha_jm:
5456
node.remote_jm_devices = storage_node_ops._connect_to_remote_jm_devs(node)
5557
node.write_to_db()
58+
distr_controller.send_cluster_map_to_node(node)
5659

57-
distr_controller.send_dev_status_event(device, device.status)
5860
device_events.device_status_change(device, device.status, old_status)
5961
return True
6062

simplyblock_core/distr_controller.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ def get_distr_cluster_map(snodes, target_node):
115115
"status": dev_status,
116116
# "physical_label": dev.physical_label
117117
}
118-
dev_w_map.append({
119-
"weight": dev_w,
120-
"id": dev.cluster_device_order})
118+
if dev.status in [NVMeDevice.STATUS_FAILED, NVMeDevice.STATUS_FAILED_AND_MIGRATED]:
119+
dev_w_map.append({"weight": dev_w, "id": -1})
120+
else:
121+
dev_w_map.append({"weight": dev_w, "id": dev.cluster_device_order})
122+
121123
node_status = snode.status
122124
if node_status == StorageNode.STATUS_SCHEDULABLE:
123125
node_status = StorageNode.STATUS_UNREACHABLE

0 commit comments

Comments
 (0)