github-actions[bot] commented on code in PR #70846:
URL: https://github.com/apache/doris/pull/70846#discussion_r4658776008


##########
fe/fe-common/src/main/java/org/apache/doris/qe/GlobalVariable.java:
##########
@@ -190,16 +190,20 @@ private static String resolveSystemTimeZone() {
     @VarAttrDef.VarAttr(name = ENABLE_AUDIT_PLUGIN, flag = VarAttrDef.GLOBAL)
     public static boolean enableAuditLoader = true;
 
-    @VarAttrDef.VarAttr(name = AUDIT_PLUGIN_MAX_BATCH_BYTES, flag = 
VarAttrDef.GLOBAL)
+    // A negative batch threshold forces a flush for every record.
+    @VarAttrDef.VarAttr(minValue = "0", name = AUDIT_PLUGIN_MAX_BATCH_BYTES, 
flag = VarAttrDef.GLOBAL)
     public static long auditPluginMaxBatchBytes = 50 * 1024 * 1024;
 
-    @VarAttrDef.VarAttr(name = AUDIT_PLUGIN_MAX_BATCH_INTERVAL_SEC, flag = 
VarAttrDef.GLOBAL)
+    // A negative interval makes every pending batch ready to flush.
+    @VarAttrDef.VarAttr(minValue = "0", name = 
AUDIT_PLUGIN_MAX_BATCH_INTERVAL_SEC, flag = VarAttrDef.GLOBAL)

Review Comment:
   [P2] Bound the audit interval before converting it to milliseconds
   
   The new lower bound still accepts `SET GLOBAL 
audit_plugin_max_batch_interval_sec = 9223372036854775807`. 
`AuditLoader.loadIfNecessary()` multiplies this long by 1000, which wraps to 
-1000, so its elapsed-time condition becomes true after every event. Because 
`LoadWorker` calls it after each assembled record, each audit record issues its 
own synchronous stream load, defeating batching and slowing the worker. Add an 
upper bound of `Long.MAX_VALUE / 1000`, or saturate the conversion in the 
consumer.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to