Elia-Renzoni commented on code in PR #1670:
URL: https://github.com/apache/ratis/pull/1670#discussion_r4443535502


##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -239,6 +239,31 @@ static void setOption(RaftProperties properties, Option 
option) {
       set(properties::setEnum, OPTION_KEY, option);
     }
 
+    /**
+     * When enabled, a linearizable read fails immediately, instead of waiting,
+     * if its read index is ahead of the applied index by at least the 
fail-fast gap.
+     */
+    String LINEARIZABLE_FAIL_FAST_GAP_ENABLED_KEY = PREFIX + 
".linearizable.fail-fast.gap.enabled";
+    boolean LINEARIZABLE_FAIL_FAST_GAP_ENABLED_DEFAULT = false;
+    static boolean linearizableFailFastGapEnabled(RaftProperties properties) {
+      return getBoolean(properties::getBoolean, 
LINEARIZABLE_FAIL_FAST_GAP_ENABLED_KEY,
+          LINEARIZABLE_FAIL_FAST_GAP_ENABLED_DEFAULT, getDefaultLog());
+    }
+    static void setLinearizableFailFastGapEnabled(RaftProperties properties, 
boolean enabled) {
+      setBoolean(properties::setBoolean, 
LINEARIZABLE_FAIL_FAST_GAP_ENABLED_KEY, enabled);
+    }
+
+    String LINEARIZABLE_FAIL_FAST_GAP_KEY = PREFIX + 
".linearizable.fail-fast.gap";
+    /** 1 means failing any read that would otherwise wait. */
+    long LINEARIZABLE_FAIL_FAST_GAP_DEFAULT = 1L;

Review Comment:
   fixed here: 60f23189024ba03704778692e6d471911f5376a6



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to