You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "huaxingao (via GitHub)" <gi...@apache.org> on 2026/01/02 22:33:48 UTC

Re: [PR] Add idempotency adapter and E2E coverage [iceberg]

huaxingao commented on code in PR #14773:
URL: https://github.com/apache/iceberg/pull/14773#discussion_r2658490063


##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -122,6 +124,11 @@ public RESTCatalogAdapter(Catalog catalog) {
     this.asViewCatalog = catalog instanceof ViewCatalog ? (ViewCatalog) catalog : null;
   }
 
+  /** Test helper to simulate a transient 503 after the first successful mutation for a key. */
+  public void simulate503OnFirstSuccessForKey(String key) {

Review Comment:
   Good suggestion. I kept it 503-specific since the test hook is only used to exercise retry behavior for transient 503/commit-state-unknown; happy to generalize later if we add tests needing other codes.



##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -122,6 +124,11 @@ public RESTCatalogAdapter(Catalog catalog) {
     this.asViewCatalog = catalog instanceof ViewCatalog ? (ViewCatalog) catalog : null;
   }
 
+  /** Test helper to simulate a transient 503 after the first successful mutation for a key. */
+  public void simulate503OnFirstSuccessForKey(String key) {
+    simulate503OnFirstSuccessKeys.add(key);
+  }
+
   private static OAuthTokenResponse handleOAuthRequest(Object body) {

Review Comment:
   Good point. Plan endpoints aren’t wrapped with withIdempotency yet. I’ll follow up with a separate PR to add Idempotency-Key support for the plan APIs (wrap handlers + add tests) and we can extend the simulation coverage there.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org