Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,11 @@ public class Config extends ConfigBase {
"Whether to enable binlog feature"})
public static boolean enable_feature_binlog = false;

@ConfField(mutable = false, description = {
"是否默认为 Database/Table 启用binlog特性",
"Whether to enable binlog feature for Database/Table by default"})
public static boolean force_enable_feature_binlog = false;

@ConfField(mutable = false, masterOnly = false, expType = ExperimentalType.EXPERIMENTAL, description = {
"设置 binlog 消息最字节长度",
"Set the maximum byte length of binlog message"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

import org.apache.doris.catalog.Env;
import org.apache.doris.cluster.ClusterNamespace;
import org.apache.doris.common.Config;
import org.apache.doris.common.ErrorCode;
import org.apache.doris.common.ErrorReport;
import org.apache.doris.common.FeNameFormat;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.InternalDatabaseUtil;
import org.apache.doris.common.util.PrintableMap;
import org.apache.doris.common.util.PropertyAnalyzer;
import org.apache.doris.mysql.privilege.PrivPredicate;
import org.apache.doris.qe.ConnectContext;

Expand All @@ -42,6 +44,11 @@ public CreateDbStmt(boolean ifNotExists, String dbName, Map<String, String> prop
this.ifNotExists = ifNotExists;
this.dbName = dbName;
this.properties = properties == null ? new HashMap<>() : properties;

if (Config.force_enable_feature_binlog
&& !this.properties.containsKey(PropertyAnalyzer.PROPERTIES_BINLOG_ENABLE)) {
this.properties.put(PropertyAnalyzer.PROPERTIES_BINLOG_ENABLE, "true");
}
}

public String getFullDbName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ public DatabaseProperty getDbProperties() {

public void setDbProperties(DatabaseProperty dbProperties) {
this.dbProperties = dbProperties;
if (PropertyAnalyzer.hasBinlogConfig(dbProperties.getProperties())) {
binlogConfig = dbProperties.getBinlogConfig();
}
}

public long getUsedDataQuotaWithLock() {
Expand Down