nooneuse commented on code in PR #66307:
URL: https://github.com/apache/doris/pull/66307#discussion_r3842174022
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/constraint/ConstraintManager.java:
##########
@@ -117,20 +157,90 @@ public void addConstraint(TableNameInfo tableNameInfo,
String constraintName,
tableNameInfo, (ForeignKeyConstraint) constraint);
}
tableConstraints.put(constraintName, constraint);
+ if (constraint instanceof DistributionMappingConstraint) {
+ putTableLocalConstraint(table, constraintName, constraint);
+ }
if (!replay) {
- logAddConstraint(tableNameInfo, constraint);
+ logItem = submitAddConstraint(tableNameInfo, constraint);
}
LOG.info("Added constraint {} on table {}", constraintName, key);
} finally {
writeUnlock();
+ if (acquireFrontendAdmission) {
+ frontendAdmissionLock.unlock();
+ }
+ }
+ return logItem;
+ }
+
+ public void acquireFrontendAdmission() throws DdlException {
+ try {
+ if (!frontendAdmissionLock.tryLock(
+ Config.catalog_try_lock_timeout_ms,
TimeUnit.MILLISECONDS)) {
+ throw new DdlException("Failed to acquire frontend admission
lock. Try again");
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new DdlException("Interrupted while acquiring frontend
admission lock", e);
+ }
+ boolean admitted = false;
+ try {
+ readLock();
+ try {
+ for (Map<String, Constraint> tableConstraints :
constraintsMap.values()) {
Review Comment:
okay
--
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]