[Bug]: SpannerIO.Write#withWriteResults() silently drops failed mutations when FailureMode.REPORT_FAILURES is set

Đang mở
#41,764 1 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 2 ngày

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

Từ ngày 30/11/2026.

  • #41765 của @vijaykarthiktk — đang mở

Đánh giá

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

Mô tả

bug good first issue io java P2
What happened?

When SpannerIO.write() (or SpannerIO.write().grouped()) is configured with both FailureMode.REPORT_FAILURES and withWriteResults(), failed mutations are silently lost:

PCollection<WriteResults> results =
    mutations.apply(
        SpannerIO.write()
            .withProjectId(...)
            .withInstanceId(...)
            .withDatabaseId(...)
            .withFailureMode(FailureMode.REPORT_FAILURES)
            .withWriteResults());

Current behavior:

  1. In WriteToSpannerFn.processElement(), FailureMode.REPORT_FAILURES catches SpannerException, retries individual MutationGroups, and outputs failures to failedTag (which populates SpannerWriteResult.getFailedMutations()) instead of throwing.
  2. WriteWithResults / WriteGroupedWithResults returns PCollection<WriteResults> (result.getWriteResults()) and discards result.getFailedMutations().
  3. Neither withWriteResults() nor WriteWithResults.expand() rejects FailureMode.REPORT_FAILURES, so failures are neither thrown nor reachable by the caller.

Expected behavior:

  • WriteWithResults / WriteGroupedWithResults should either fail fast at pipeline construction/validation time (IllegalArgumentException) when failureMode == FailureMode.REPORT_FAILURES (since PCollection<WriteResults> cannot expose failedMutations), or
  • Callers needing both WriteResults and failedMutations should be able to obtain SpannerWriteResult with commitStats enabled (note that SpannerWriteResult already exposes both getFailedMutations() and getWriteResults(), though SpannerIO.Write currently has no public builder method for commitStats without withWriteResults()).
Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components
  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Prism Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
Ngôn ngữ chính
Java
Star
8.7k
Fork
4.8k
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
445

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

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 apache/beam

Tất cả issue của apache/beam

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.