Skip to content

Commit 85de0b5

Browse files
committed
kvm: bound Ceph operations by default
Default rados.osd.op.timeout to 60 and rados.mon.op.timeout to 30. With the options left unset, an operation that never completes still parks the agent thread, and with it the host's storage command queue, for anyone who does not know to set them. A failed operation can be retried; a wedged host cannot. Setting either property to 0 still leaves the option unset and keeps the librados behaviour of waiting forever, and a cluster whose single operations legitimately run longer can raise them. Signed-off-by: Brad House <bhouse@nexthop.ai>
1 parent 7f56e8e commit 85de0b5

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎agent/conf/agent.properties‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -463,18 +463,17 @@ iscsi.session.cleanup.enabled=false
463463

464464
# Time, in seconds, that a single Ceph OSD operation may block before it fails. This bounds one operation
465465
# and not a whole request, so a long running copy or flatten is made up of many operations that are each
466-
# well inside the limit.
467-
# The default of 0 leaves the option unset, which is the librados behaviour of waiting forever. An
468-
# operation that never completes parks the agent thread that issued it, and because the agent runs a
469-
# host's storage commands in sequence, every command queued behind it stops with it.
470-
# Setting a limit is recommended. 60 is a reasonable starting point: it is far above a normal operation
471-
# on a healthy cluster, while still bounding one that will never return.
472-
# rados.osd.op.timeout=0
466+
# well inside the limit. 60 is far above a normal operation on a healthy cluster, while still bounding one
467+
# that will never return.
468+
# Set to 0 to leave the option unset, which is the librados behaviour of waiting forever. An operation
469+
# that never completes then parks the agent thread that issued it, and because the agent runs a host's
470+
# storage commands in sequence, every command queued behind it stops with it. Raise the limit instead on
471+
# a cluster where single operations legitimately run longer, for example during heavy recovery.
472+
# rados.osd.op.timeout=60
473473

474474
# Time, in seconds, that a single Ceph monitor operation may block before it fails.
475-
# The default of 0 leaves the option unset, which is the librados behaviour of waiting forever.
476-
# 30 is a reasonable starting point.
477-
# rados.mon.op.timeout=0
475+
# Set to 0 to leave the option unset, which is the librados behaviour of waiting forever.
476+
# rados.mon.op.timeout=30
478477

479478
# Time, in seconds, that the Ceph client may spend connecting to the monitors.
480479
# Set to 0 to leave the option unset and keep the librados default.

‎agent/src/main/java/com/cloud/agent/properties/AgentProperties.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -918,22 +918,22 @@ public Property<Integer> getWorkers() {
918918
* Time, in seconds, that a single Ceph OSD operation may block before it fails.<br>
919919
* This bounds each operation, not a whole request, so a long running copy or flatten is made up of
920920
* many operations that are each well inside the limit.<br>
921-
* The default of <code>0</code> leaves the option unset, which keeps the librados behaviour of waiting
921+
* Set to <code>0</code> to leave the option unset, which keeps the librados behaviour of waiting
922922
* forever. A stuck operation then blocks the agent thread that issued it, and with it every storage
923-
* command queued behind it for that host, so setting a limit is recommended.<br>
923+
* command queued behind it for that host.<br>
924924
* Data type: Integer.<br>
925-
* Default value: <code>0</code>
925+
* Default value: <code>60</code>
926926
*/
927-
public static final Property<Integer> RADOS_OSD_OP_TIMEOUT = new Property<>("rados.osd.op.timeout", 0);
927+
public static final Property<Integer> RADOS_OSD_OP_TIMEOUT = new Property<>("rados.osd.op.timeout", 60);
928928

929929
/**
930930
* Time, in seconds, that a single Ceph monitor operation may block before it fails.<br>
931-
* The default of <code>0</code> leaves the option unset, which keeps the librados behaviour of waiting
931+
* Set to <code>0</code> to leave the option unset, which keeps the librados behaviour of waiting
932932
* forever.<br>
933933
* Data type: Integer.<br>
934-
* Default value: <code>0</code>
934+
* Default value: <code>30</code>
935935
*/
936-
public static final Property<Integer> RADOS_MON_OP_TIMEOUT = new Property<>("rados.mon.op.timeout", 0);
936+
public static final Property<Integer> RADOS_MON_OP_TIMEOUT = new Property<>("rados.mon.op.timeout", 30);
937937

938938
/**
939939
* Time, in seconds, that the Ceph client may spend connecting to the monitors.<br>

0 commit comments

Comments
 (0)