infer: adding a field to After only on an update with a Before image fails the record

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend, data

Hướng nghiên cứu

Start by tracing the default infer schema encoding for records with structured Before and After payloads; the issue does not name implementation files or tests. Reproduce with an Avro attached update where a top level field is added to After, then inspect how the inferred schema handles the missing field in Before. Done when the record encodes with the expected nullable field behavior or returns a clear error naming the field and remedy.

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

Mô tả

Summary

On a record that has both a structured Before and After and carries a schema, a processor that adds a
top-level field to After only fails the record under the default infer strategy. This is the mirror of
the removal case fixed in v0.10.0 (#195). It is not a regression: v0.9.2 fails the same way.

Reproduce

An Avro-attached update (for example Postgres CDC with REPLICA IDENTITY FULL) with
Before = {id: 1, name: "a"} and After = {id: 1, name: "b"}. In Conduit, run any of these on it:

  • field.set on .Payload.After.added
  • field.rename on .Payload.After.name to full_name, After only
  • a custom.javascript that adds a property to After

Actual

The record fails. infer takes the schema from After, which now has the new field. Before lacks that
field, so encoding it fails with missing required field (in v0.10.0 the rename case reports
ErrFieldNotInSchema on the old name). Same result with and without a NULL flip, same on v0.9.2 and v0.10.0.

Expected

Either the added field is also made nullable in the inferred schema and Before encodes with the field null
(as the NULL-flip handling in #195 already does for fields nil on one side), or the record fails with a clear
error that names the field and the remedy (add it to Before too). The current message does not say which.

Notes

  • sdk.schema.encode.payload.strategy: extend does not help: it rejects a top-level difference between
    Before and After with ErrSchemaExtendMismatch.
  • Workaround: set the field on both parts (.Payload.Before.added and .Payload.After.added).
  • Anyone using field.set to stamp CDC updates hits this. Conduit processor probe results are in the Conduit
    PR bumping to v0.10.0.
Ngôn ngữ chính
Go
Star
1
Fork
1
Merge trung bình
11 phút
Pull request đã merge (30 ngày)
5

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 ConduitIO/conduit-processor-sdk

Tất cả issue của ConduitIO/conduit-processor-sdk

Issue tương tự

Thêm issue về Go

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.