[fix](Nereids): don't log edit log when replaying (#30578)
* don't log edit log when replaying
This commit is contained in:
@ -327,7 +327,7 @@ public interface TableIf {
|
||||
}
|
||||
}
|
||||
|
||||
default void dropConstraint(String name) {
|
||||
default void dropConstraint(String name, boolean replay) {
|
||||
writeLock();
|
||||
try {
|
||||
Map<String, Constraint> constraintMap = getConstraintsMapUnsafe();
|
||||
@ -341,7 +341,9 @@ public interface TableIf {
|
||||
((PrimaryKeyConstraint) constraint).getForeignTables()
|
||||
.forEach(t -> t.dropFKReferringPK(this, (PrimaryKeyConstraint) constraint));
|
||||
}
|
||||
Env.getCurrentEnv().getEditLog().logDropConstraint(new AlterConstraintLog(constraint, this));
|
||||
if (!replay) {
|
||||
Env.getCurrentEnv().getEditLog().logDropConstraint(new AlterConstraintLog(constraint, this));
|
||||
}
|
||||
} finally {
|
||||
writeUnlock();
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public class DropConstraintCommand extends Command implements ForwardWithSync {
|
||||
@Override
|
||||
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
|
||||
TableIf table = extractTable(ctx, plan);
|
||||
table.dropConstraint(name);
|
||||
table.dropConstraint(name, false);
|
||||
}
|
||||
|
||||
private TableIf extractTable(ConnectContext ctx, LogicalPlan plan) {
|
||||
|
||||
@ -983,7 +983,7 @@ public class EditLog {
|
||||
}
|
||||
case OperationType.OP_DROP_CONSTRAINT: {
|
||||
final AlterConstraintLog log = (AlterConstraintLog) journal.getData();
|
||||
log.getTableIf().dropConstraint(log.getConstraint().getName());
|
||||
log.getTableIf().dropConstraint(log.getConstraint().getName(), true);
|
||||
break;
|
||||
}
|
||||
case OperationType.OP_ALTER_USER: {
|
||||
|
||||
Reference in New Issue
Block a user