Orleans Grain Persistence ETag Guidance

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

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu tại docs/orleans/grains/grain-persistence/index.md và đọc phần xung quanh “Write state.” Thêm phần “ETag and Optimistic Concurrency” được yêu cầu cùng với cảnh báo và bảng hành vi, đồng thời giữ nguyên phần Document Details bắt buộc. Hoàn thành khi trang giải thích rõ hành vi của ETag và hướng dẫn được yêu cầu xuất hiện sau “Write state.”

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

:watch: Not Triaged dotnet-orleans/svc
Describe the issue or suggestion

Page: Grain persistence

Add a new section titled "ETag and Optimistic Concurrency" after the "Write state" section, with a warning and do's/don'ts table:

Understanding ETag behavior is essential when working with grain persistence, especially in reentrant grains or when state may be modified externally. Mishandling ETags can lead to data loss or InconsistentStateException errors. Some providers leave this as null if they don't use Etags. This is why thorough testing of providers is required.

The ETag property provides optimistic concurrency control. When you call WriteStateAsync() or ClearStateAsync(), the storage provider compares the grain's current ETag with the value in storage. If they don't match (indicating another write occurred), the operation fails with an InconsistentStateException.

Behaviors:
ReadStateAsync(): Updates both State and ETag from storage
WriteStateAsync(): Fails if ETag doesn't match storage; updates ETag on success
ClearStateAsync(): Fails if ETag doesn't match storage; resets ETag to null on success
Setting ETag = null before write/clear operations bypasses version checking


Document Details

⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
4.8k
Fork
6.1k
Merge trung bình
22 giờ 46 phút
Pull request đã merge (30 ngày)
296

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 dotnet/docs

Tất cả issue của dotnet/docs

Issue tương tự

Thêm issue về Documentation

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.