hello-stephen commented on code in PR #69391:
URL: https://github.com/apache/doris/pull/69391#discussion_r4795372376
##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/kafka/KafkaRoutineLoadJob.java:
##########
@@ -196,6 +198,28 @@ private long convertedDefaultOffsetToLong() {
}
}
+ private static void checkPropertyBlacklist(Map<String, String> properties)
throws AnalysisException {
+ List<String> blockedProperties =
Arrays.asList(Config.routine_load_kafka_property_blacklist);
+ for (String key : properties.keySet()) {
+ // librdkafka reads the property name as a NUL-terminated string.
+ int nul = key.indexOf('\0');
+ String effectiveKey = nul < 0 ? key : key.substring(0, nul);
+ if (blockedProperties.contains(effectiveKey)) {
+ throw new AnalysisException("Kafka property '" + effectiveKey
+ "' is not allowed in Routine Load");
+ }
+ }
+ }
+
+ public void checkPropertiesAfterReplay() throws UserException {
+ // All journal entries have been applied and the master has not
started its schedulers yet.
+ try {
+ checkPropertyBlacklist(customProperties);
+ } catch (AnalysisException e) {
+ updateState(JobState.CANCELLED,
Review Comment:
[P2] Preserve authoritative Kafka offsets when cancelling Cloud jobs
Cloud commits persist Kafka offsets in Meta Service. When this call cancels
a recovered job, the promoted FE can still have the older offsets from its
image and journal. `RoutineLoadManager.updateRoutineLoadJob()` skips final
jobs, and `SHOW ROUTINE LOAD` reads the FE's local progress. Recreating the job
from those displayed offsets can reingest records that committed before
promotion. Please make the durable Meta Service offsets available for cancelled
jobs so operators can restart from the correct position.
##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -1222,6 +1222,11 @@ public class Config extends ConfigBase {
*/
@ConfField public static boolean enable_metric_calculator = true;
+ @ConfField(description = "Comma-separated Kafka property names blocked in
Routine Load, without the property. "
+ + "prefix. An explicit nonempty list replaces the defaults. On
master promotion, jobs using a blocked "
+ + "property are cancelled before scheduling.")
+ public static String[] routine_load_kafka_property_blacklist =
{"sasl.kerberos.kinit.cmd", "plugin.library.paths"};
Review Comment:
[P3] Reject a blacklist override with no property names
A startup value made up only of comma separators passes
`ConfigBase.setFields()`'s nonempty string check. `setConfigField()` then
splits it into an empty array and replaces both defaults, leaving CREATE,
ALTER, and promotion with no blocked keys. Reject the malformed override or
retain the defaults when parsing yields no property names. The custom-list test
assigns the array directly, so please cover this through startup config parsing.
--
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]