In `avro-enable-watermark=true` using AWS Glue Schema Registry, "DELETE" event and normal event has colliding magic byte

Open Beginner friendly
#5,552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
aws, go

Research direction

Start with the referenced byte definitions in pkg/sink/codec/avro/helper.go and pkg/sink/codec/avro/glue_schema_registry.go, then trace the identification logic in pkg/sink/codec/avro/decoder.go. Confirm which internal-use bytes collide with AWS Glue's header version byte, update the internal values without overlapping Glue messages, and verify that DELETE and normal events are distinguished when avro-enable-watermark and AWS Glue Schema Registry are both enabled.

Written by the indexing model from the issue text.

Description

deleteByte is 3

https://github.com/pingcap/ticdc/blob/41b855b10b129a6b4af681a6f1b02362f6e4f104/pkg/sink/codec/avro/helper.go#L48-L55

The headerVersionByte of a Glue message is also 3

https://github.com/pingcap/ticdc/blob/41b855b10b129a6b4af681a6f1b02362f6e4f104/pkg/sink/codec/avro/glue_schema_registry.go#L325-L332

This will lead to mis-identification when both avro-enable-watermark and AWS Glue Schema Registry are used, e.g.

https://github.com/pingcap/ticdc/blob/41b855b10b129a6b4af681a6f1b02362f6e4f104/pkg/sink/codec/avro/decoder.go#L194-L199

I suggest changing the 3 internal-use bytes to some value far away from these magic bytes, and probably don't occupy three slots for internal use. Maybe change to e.g. cd c1, cd c2, cd c3.

(Internal reference: GTOC-8564/NAID-12126)

Dominant language
Go
Stars
56
Forks
63
Avg merge
2d 17h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingcap/ticdc

All issues in pingcap/ticdc

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.