wuchong commented on code in PR #3612:
URL: https://github.com/apache/fluss/pull/3612#discussion_r3566480852


##########
fluss-common/src/main/java/org/apache/fluss/config/ConfigOptions.java:
##########
@@ -385,10 +385,24 @@ public class ConfigOptions {
                     .doubleType()
                     .defaultValue(0.85)
                     .withDescription(
-                            "Reject writes when the tablet server data disk 
usage exceeds this ratio. "
-                                    + "Writes resume after the usage drops 
below (ratio - 0.10). "
+                            "Reject writes when the tablet server data disk 
usage reaches this ratio. "
+                                    + "Writes resume after the usage drops 
below "
+                                    + "(server.data-disk.write-limit-ratio - "
+                                    + 
"server.data-disk.write-limit-recover-gap). "
                                     + "Set to 1.0 to disable the disk-usage 
protection entirely. "
-                                    + "The valid range is (0.1, 1.0].");
+                                    + "The valid range is "
+                                    + 
"(server.data-disk.write-limit-recover-gap, 1.0].");
+
+    public static final ConfigOption<Double> 
SERVER_DATA_DISK_WRITE_LIMIT_RECOVER_GAP =
+            key("server.data-disk.write-limit-recover-gap")

Review Comment:
   Could we consider renaming these configuration keys and expressing both 
values as absolute watermarks?
   
   Currently, we have:
   
   - `server.data-disk.write-limit-ratio`
   - `server.data-disk.write-limit-recover-gap`
   
   Combining an absolute ratio with a relative gap requires users to calculate 
the actual recovery threshold themselves (`limit-ratio - recover-gap`). It also 
makes validation and dynamic updates harder to reason about.
   
   I suggest using two mirrored thresholds that map directly to the 
write-protection state transitions:
   
   - **`server.data-disk.write-limit-ratio`** — for example, `0.85`, at which 
write protection is activated.
   - **`server.data-disk.write-recover-ratio`** — for example, `0.80`, at which 
write protection is deactivated.
   
   The relationship then becomes straightforward:
   
   ```text
   0 < write-recover-ratio < write-limit-ratio <= 1.0
   ```
   



-- 
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