Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Double-wrapped OpenCDC records #1351

Closed
raulb opened this issue Jan 25, 2024 · 2 comments · Fixed by #1343
Closed

Bug: Double-wrapped OpenCDC records #1351

raulb opened this issue Jan 25, 2024 · 2 comments · Fixed by #1343
Assignees
Labels
bug Something isn't working

Comments

@raulb
Copy link
Member

raulb commented Jan 25, 2024

Bug description

While the source pipeline produces a valid OpenCDC record, the destination will consume this from Kafka, assume it is raw data and create a new OpenCDC record with the source record set as rawdata in the Payload.After field. It ends up being re-wrapped in another OpenCDC record, making it double-wrapped.

Suggestions:

  • Add an OpenCDC unwrap processor
  • When producing to kafka topics on the platform, only emit the contents of payload.After

Steps to reproduce

  1. Create a pipeline that uses a destination builtin conduit connector. example:
version: 1.0
pipelines:
  gen-to-kafka:
    status: running
    description: >
     generator to kafka
    connectors:
      source-generator:
        type: source
        plugin: builtin:generator
        settings:
          format.options: event_id:int,pg_generator:bool,sensor_id:int,msg:string,triggered:bool
          format.type: structured
          recordCount: 100
          readTime: 1000ms
      dest-kafka:
        type: destination
        plugin: standalone:kafka
        settings:
          insecureSkipVerify: true
          servers: <put local kafka brokers here>
          topic: demo-123
  1. Make sure you produce a record that can be produced by the destination connector. Consuming that record you'll notice it double wrapped. Example:
{
  "key": "MTc3NzQ5NDEtNTdhMi00MmZhLWI0MzAtODkxMmE5NDI0YjNh",
  "metadata": {
    "conduit.source.connector.id": "dest-log-78lpnchx7tzpyqz:source-kafka",
    "kafka.topic": "stream-78lpnchx7tzpyqz-generator",
    "opencdc.createdAt": "1706028953595000000",
    "opencdc.readAt": "1706028953606997000",
    "opencdc.version": "v1"
  },
  "operation": "create",
  "payload": {
    "after": {
        "position": "NzgyNjJmODUtODNmMS00ZGQwLWEyZDAtNTRmNjA1ZjkyYTg0",
        "operation": "create",
        "metadata": {
          "conduit.source.connector.id": "source-generator-78lpnchx7tzpyqz:source",
          "opencdc.readAt": "1706028953595546000",
          "opencdc.version": "v1"
        },
        "key": "MTc3NzQ5NDEtNTdhMi00MmZhLWI0MzAtODkxMmE5NDI0YjNh",
        "payload": {
          "before": null,
          "after": {
            "event_id": 1747353650,
            "msg": "string 0e8955b3-7fb5-4dda-8064-e10dc007f00d",
            "pg_generator": false,
            "sensor_id": 1250383582,
            "triggered": false
          }
        }
      },
    "before": null
  },
  "position": "eyJHcm91cElEIjoiNGQ2ZTBhMjktNzAwZi00Yjk4LWEzY2MtZWUyNzZhZTc4MjVjIiwiVG9waWMiOiJzdHJlYW0tNzhscG5jaHg3dHpweXF6LWdlbmVyYXRvciIsIlBhcnRpdGlvbiI6MCwiT2Zmc2V0IjoyMjF9"
}

Version

v0.8.0

@raulb raulb added bug Something isn't working triage Needs to be triaged labels Jan 25, 2024
@raulb raulb changed the title Bug: <title> Bug: Double-wrapped OpenCDC records Jan 25, 2024
@raulb raulb moved this from Triage to In Progress in Conduit Main Jan 25, 2024
@raulb raulb self-assigned this Jan 25, 2024
@raulb raulb removed the triage Needs to be triaged label Jan 25, 2024
@raulb raulb mentioned this issue Jan 25, 2024
4 tasks
@hariso
Copy link
Contributor

hariso commented Jan 25, 2024

@raulb This looks to be an issue when Kafka is used as an intermediary? For example, source foo -> kafka -> destination bar?

@raulb
Copy link
Member Author

raulb commented Jan 25, 2024

@hariso correct.

@raulb raulb moved this from In Progress to In Review in Conduit Main Jan 30, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Conduit Main Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants