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

オープン
#41,764 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@vijaykarthiktk がすでに取り組んでいます。

2026年11月30日 から。

  • #41765 @vijaykarthiktk による — オープン

評価

この issue はまだ評価されていません。

説明

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
主要言語
Java
スター
8.7k
フォーク
4.8k
平均マージ
3日 16時間
マージ済み PR(30日)
445

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/beam のほかの issue

apache/beam の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。