swuferhong commented on code in PR #2126:
URL: https://github.com/apache/fluss/pull/2126#discussion_r2616965373
##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/MetadataManager.java:
##########
@@ -279,7 +284,12 @@ public long createTable(
boolean ignoreIfExists)
throws TableAlreadyExistException, DatabaseNotExistException {
// validate table properties before creating table
- validateTableDescriptor(tableToCreate, maxBucketNum);
+ int dbLevelMaxBucket =
+ DatabaseLimitResolver.resolveMaxBucketForDb(
+ maxBucketNum,
+ dynamicConfigManager.describeConfigs(),
+ tablePath.getDatabaseName());
+ validateTableDescriptor(tableToCreate, maxBucketNum, dbLevelMaxBucket);
Review Comment:
> @swuferhong `maxBucketNum` is still used to represent the maximum limit of
the cluster. I will use two variables to distinguish them: `maxBucketNumOfDb`
and `maxBucketNumOfCluster`. How do you think?
What concerns me most is the implementation. Theoretically, the
cluster-level logic should be holistic—when creating a table, it should first
check how many buckets currently exist in the cluster and then determine
whether the table can be created. However, the current cluster-level
implementation actually checks individual tables during creation.
I think it's reasonable to separate these two aspects, and future expansion
maybe consider for the cluster level limit.
--
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]