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: sometimes an _id field gets removed from a record payload #37

Open
oykmnk opened this issue Feb 15, 2023 · 1 comment
Open

Bug: sometimes an _id field gets removed from a record payload #37

oykmnk opened this issue Feb 15, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@oykmnk
Copy link
Contributor

oykmnk commented Feb 15, 2023

Bug description

When using the MongoDB Source connector and sending a payload containing an _id field, it is sometimes removed from the record payload but not from the record key. This issue occurs when there are more than two destinations, which makes it a peculiar bug.

The Snapshot iterator has the following code:

return sdk.Util.Source.NewRecordSnapshot(
	sdkPosition, metadata,
	sdk.StructuredData{idFieldName: element[idFieldName]}, sdk.StructuredData(element),
), nil

Here, the map called "element" is used to construct a record key (sdk.StructuredData{idFieldName: element[idFieldName]}) and a payload (sdk.StructuredData(element)). The map is not modified afterward, so it's unclear why the payload sometimes doesn't contain the _id field while the record key always does.

Steps to reproduce:

  1. Add data to a MongoDB collection
  2. Create a pipeline with a MongoDB Source connector for the collection, and File, Postgres, and Materialize Destination connectors
  3. Start the pipeline
  4. Check the transmitted payload (may need to repeat the process as the bug is not stable)

Version

Conduit v0.5.2, MongoDB connector 4736288

@oykmnk oykmnk added the bug Something isn't working label Feb 15, 2023
@hariso hariso moved this to Triage in Conduit Main Nov 8, 2024
@alarbada alarbada moved this from Todo to In Progress in Conduit Main Dec 5, 2024
@alarbada
Copy link

alarbada commented Dec 5, 2024

Hello @oykmnk, I know it's been a while, I've got a few questions before delving deeper into this:

  1. Do you remember with what kind of schema did this bug happen?
  2. Do you remember the mongodb connection parameters?
  3. Do you remember when did the bug happen? Only when snapshotting, or also when the connector was on cdc mode?
  4. By any chance, do you remember what pipeline config file were you using.

I'm asking because I tried to reproduce the bug with a simple pipeline from mongodb to file and I couldn't reproduce the bug. It also looks like this happened in an older conduit version, we are now on v0.12.2.

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
None yet
Development

No branches or pull requests

2 participants