Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[FEATURE REQ] Port hub region caching per partition level from .NET SDK

Đang mở
#48,788 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jeet1995 đang làm issue này rồi.

Từ ngày 12/4/2026.

  • #48789 của @jeet1995 — đã đóng, không merge

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Client Cosmos

Summary

Port the per-partition hub region caching feature from .NET SDK (PR Azure/azure-cosmos-dotnet-v3#5648) to the Java SDK.

Background

On single-master accounts encountering repeated 404/1002 (ReadSessionNotAvailable) errors, the SDK should discover the hub region via a 403/3 (WriteForbidden) discovery chain and cache the result per partition. Subsequent requests to the same partition route directly to the cached hub, eliminating redundant discovery round-trips.

Key Behavior

  • After 2 consecutive 404/1002 on a single-master account, set \x-ms-cosmos-hub-region-processing-only\ header
  • Non-hub regions return 403/3 (WriteForbidden) — SDK retries to next region (discovery chain)
  • Hub region responds with 200 OK — SDK caches hub URI for that partition
  • Future requests route directly to cached hub (warm path)
  • Works for both PPAF and non-PPAF accounts
  • Must be gated by a feature flag / environment variable (per Debdatta's guidance)

.NET Reference

Java SDK Files Likely Affected

  • \ClientRetryPolicy.java\
  • \GlobalPartitionEndpointManager.java\ / related partition failover classes
  • \RxGatewayStoreModel.java\
  • \Configs.java\ (feature flag)

Acceptance Criteria

  • Hub region discovery via 403/3 chain after 2x 404/1002 on single-master
  • Per-partition hub region caching (warm path skips discovery)
  • Feature flag gate (environment variable, disabled by default initially)
  • Works for both PPAF and non-PPAF accounts
  • Unit tests + integration tests
Ngôn ngữ chính
Java
Star
2.6k
Fork
2.2k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
220

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-sdk-for-java

Tất cả issue của Azure/azure-sdk-for-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.