-
Notifications
You must be signed in to change notification settings - Fork 60
Fail to write to DB 'The $v update field is only recognized internally' #91
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
Comments
Some more inputs, the following is the events structure with the $v in the patch :
|
Hi @mottish! Thx for reporting your issue. It seems that this is indeed a bug at least for MongoDB versions 3.6+ Obviously this field $v has been added to the oplog format and is not expected by the current implementation. When you look at the documentation of the update format in the Debezium docs https://debezium.io/docs/connectors/mongodb/#change-events-value you can see that the "$v" field is not mentioned there. However there is the following note:
So from what I've quickly seen I'm afraid you need to wait until a fix is provided. PR is of course welcome :) |
Hans, mongos> db.demo_collA.updateOne({"_id" : "10129-2015-CMPL", "certificate_number" : 5346909},{ $set: {"business_name" : "RJ A&C CHIMNEY CORP."}}) Above update() triggering below exception. My current source and target db version is 3.6.8. As per your explanation, it seems this issue is related to 3.6 and above versions. Do you have a plan to fix this bug in upcoming releases? I am assuming upgrading to 4.0 may not help. Correct me if I am wrong. Alos downgrading to 3.4 is not an option in my case. |
THX for checking this! Of course a fix is planned for the next patch release 1.3.2. Cannot tell right now when there will be an official release but as soon as there is a fix on master I'll let you know :) Ideally someone from the community steps up and sends a PR - would you like to? |
Thanks, Hans for a reply. I wish I have a java skill already to fix this issue. I am an operational guy with little coding knowledge :). |
I'm pretty sure the official connector is also affected. AFAIK there were no considerable functional changes for the sink side - at least none that I'm aware of. Additionally, the bug is related to processing events coming from another 3rd party project, namely Debezium so I think it would currently not have a very high priority. What I'll do however is provide the fix in the official repo as well after seeing an knowing that it works here. |
Thanks, Hans. Appreciate it. |
I already looked into it. The fix itself is a trivial one for this very issue. But it will still take me a bit to adapt unit tests, documentation etc. and do a hotfix release. Try to find some time at the beginning of next week. |
Hi @hpgrahsl, Thank you for looking into it quickly! Thanks again for your great work with this connector! |
Hi @hpgrahsl , I continue to do testing with large dataset 34 million records in a live test environment and I got another bulk write operation error as below. Thought I will share with you. 2019-07-12 07:20:13,606] ERROR writing 472 document(s) into collection [oz_next_new.assets] failed -> remaining retries (3) (at.grahsl.kafka.connect.mongodb.MongoDbSinkTask:161) |
@rajarameshyv thx for sharing. honestly I haven't seen this error before... never :) [BulkWriteError{index=135, code=28, message='Cannot create field 'renditions' in element {2: null}', details={}}] Try to find out what it even means cause from this rather cryptic error message I have no idea what exactly went wrong or why the write didn't succeed. Will keep you updated. |
@mottish @rajarameshyv good news see above :-) beware though that this is with regard to the $v field issue not the other one. |
Thank you, it works! |
Thank you @hpgrahsl. Download from https://www.confluent.io/connector/kafka-connect-mongodb-sink/ will have this change? |
@rajarameshyv yes but in fact the download from confluent hub will only include this when the next release will be done and published there. until then you have to use the latest build from master branch. |
@rajarameshyv ah and what about your other issue you posted above? did you find anything why this might happen? I think it would be a good idea if you extract this part and open a separate issue for this so that we don't loose track :-) THX in advance. |
@hpgrahsl So far search using google, looks like an issue related to updating array with NULL value with some values triggering this error. But I am not 100% sure. I am planning to reproduce this from mongo shell. And Han, I don't find a procedure how to build jar file using master. Appreciate if you can post me a link or procedure. Sorry if this is a trouble for you. |
ok. I see. so directly in the project root you simple run |
Thank You @hpgrahsl. I will try this. Appreciate for sharing steps. |
You are welcome! Good luck :) |
@hpgrahsl Fix for $v update field issue working. Thank You. I will create a separate issue for other errors I am getting. |
Hi,
I'm currently testing the Sink connector and trying to Sync 2 mongoDB clusters where the source cluster is using Debezium CDC and the destination MongoDB is using your MongoDB Sink connector.
my config is:
Initially I was able to sync the clusters, however after I was trying to update a document in the source DB, I started getting the below exception.
The exception I get:
What is the problem and how can I overcome it?
The text was updated successfully, but these errors were encountered: