singhpk234 commented on code in PR #3803: URL: https://github.com/apache/polaris/pull/3803#discussion_r2825564846
########## runtime/service/src/main/java/org/apache/polaris/service/idempotency/IdempotencyConfiguration.java: ########## @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.polaris.service.idempotency; + +import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithDefault; +import java.util.List; + +@ConfigMapping(prefix = "polaris.idempotency") +public interface IdempotencyConfiguration { + + /** + * Allowlist of endpoint scopes where idempotency is enforced. + * + * <p>This is an optional safety/rollout control: it limits idempotency to specific endpoint + * prefixes and provides a stable {@link Scope#operationType()} for request binding. + * + * <p>If empty, the filter falls back to applying idempotency for Iceberg REST catalog mutating + * endpoints only. + */ + List<Scope> scopes(); + + /** Enable HTTP idempotency at the request/response filter layer. */ + @WithDefault("false") + boolean enabled(); Review Comment: when we enable this how much do we degress per last benchmarks we did https://github.com/apache/polaris/pull/1517#issue-3037027635, mostly wanna because we can warning if it regresses a lot ########## runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java: ########## @@ -1345,9 +1351,25 @@ public ConfigResponse getConfig() { PolarisEntity.of(resolvedReferenceCatalog.getEntity()).getPropertiesAsMap(); String prefix = prefixParser().catalogNameToPrefix(catalogName()); + ImmutableMap.Builder<String, String> overrides = ImmutableMap.builder(); + overrides.put("prefix", prefix); + + // Advertise idempotency support only for Polaris-managed (internal) catalogs. For + // federated/external catalogs, Polaris may not enforce idempotency end-to-end. + CatalogEntity catalogEntity = CatalogEntity.of(resolvedReferenceCatalog.getEntity()); + IdempotencyConfiguration idCfg = idempotencyConfiguration(); + if (catalogEntity != null + && org.apache.polaris.core.admin.model.Catalog.TypeEnum.INTERNAL.equals( Review Comment: inline imports, can we please avoid them ? -- 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]
