ctdb-config: Change option "no realtime" option to "realtime scheduling"
authorMartin Schwenke <martin@meltin.net>
Mon, 20 Aug 2018 03:35:33 +0000 (13:35 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 24 Aug 2018 08:59:20 +0000 (10:59 +0200)
Negative options can be confusing, so switch to a positive option.

This was supposed to be done months ago but was forgotten.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/doc/ctdb.conf.5.xml
ctdb/server/ctdb_config.c
ctdb/server/ctdb_config.h
ctdb/server/ctdbd.c
ctdb/server/legacy_conf.c
ctdb/server/legacy_conf.h
ctdb/tests/cunit/config_test_001.sh
ctdb/tests/cunit/config_test_006.sh

index bcb67b3..840d46d 100644 (file)
       </varlistentry>
 
       <varlistentry>
-       <term>no realtime = true|false</term>
+       <term>realtime scheduling = true|false</term>
        <listitem>
          <para>
            Usually CTDB runs with real-time priority. This helps it
            to perform effectively on a busy system, such as when
            there are thousands of Samba clients. If you are running
            CTDB on a platform that does not support real-time
-           priority, you can set this to <literal>true</literal>.
+           priority, you can set this to <literal>false</literal>.
          </para>
          <para>
-           Default: <literal>false</literal>
+           Default: <literal>true</literal>
          </para>
        </listitem>
       </varlistentry>
index 58bf975..1254a99 100644 (file)
@@ -88,8 +88,8 @@ static void setup_config_pointers(struct conf_context *conf)
 
        conf_assign_boolean_pointer(conf,
                                    LEGACY_CONF_SECTION,
-                                   LEGACY_CONF_NO_REALTIME,
-                                   &ctdb_config.no_realtime);
+                                   LEGACY_CONF_REALTIME_SCHEDULING,
+                                   &ctdb_config.realtime_scheduling);
        conf_assign_boolean_pointer(conf,
                                    LEGACY_CONF_SECTION,
                                    LEGACY_CONF_RECMASTER_CAPABILITY,
index 51342a4..1c06e83 100644 (file)
@@ -38,7 +38,7 @@ struct ctdb_config {
        const char *event_debug_script;
 
        /* Legacy */
-       bool no_realtime;
+       bool realtime_scheduling;
        bool recmaster_capability;
        bool lmaster_capability;
        bool start_as_stopped;
index bfdc5e0..ef829e5 100644 (file)
@@ -328,7 +328,7 @@ int main(int argc, const char *argv[])
                ctdb->capabilities &= ~CTDB_CAP_RECMASTER;
        }
 
-       ctdb->do_setsched = !ctdb_config.no_realtime;
+       ctdb->do_setsched = ctdb_config.realtime_scheduling;
 
        /*
         * Miscellaneous setup
index c435dae..5be8da0 100644 (file)
@@ -54,8 +54,8 @@ void legacy_conf_init(struct conf_context *conf)
 
        conf_define_boolean(conf,
                            LEGACY_CONF_SECTION,
-                           LEGACY_CONF_NO_REALTIME,
-                           false,
+                           LEGACY_CONF_REALTIME_SCHEDULING,
+                           true,
                            NULL);
        conf_define_boolean(conf,
                            LEGACY_CONF_SECTION,
index 6592b17..5551f12 100644 (file)
@@ -24,7 +24,7 @@
 
 #define LEGACY_CONF_SECTION "legacy"
 
-#define LEGACY_CONF_NO_REALTIME          "no realtime"
+#define LEGACY_CONF_REALTIME_SCHEDULING  "realtime scheduling"
 #define LEGACY_CONF_RECMASTER_CAPABILITY "recmaster capability"
 #define LEGACY_CONF_LMASTER_CAPABILITY   "lmaster capability"
 #define LEGACY_CONF_START_AS_STOPPED     "start as stopped"
index a3ddaab..27e8888 100755 (executable)
@@ -43,7 +43,7 @@ ok <<EOF
 [event]
        # debug script = 
 [legacy]
-       # no realtime = false
+       # realtime scheduling = true
        # recmaster capability = true
        # lmaster capability = true
        # start as stopped = false
index bfbd917..d367cd4 100755 (executable)
@@ -19,9 +19,9 @@ cat > "$conffile" <<EOF
 EOF
 
 ok <<EOF
-false
+true
 EOF
-unit_test ctdb-config get "legacy" "no realtime"
+unit_test ctdb-config get "legacy" "realtime scheduling"
 
 ok <<EOF
 true