[KAFKA-395] Fix custom Delete write model strategy support Created: 06/Jan/24  Updated: 07/Feb/24  Resolved: 16/Jan/24

Status: Closed
Project: Kafka Connector
Component/s: Configuration, Sink
Affects Version/s: 1.11.1
Fix Version/s: 1.11.2

Type: Bug Priority: Major - P3
Reporter: WooJoo Shin Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: Bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2024-01-07-02-27-12-883.png     PNG File image-2024-01-07-02-28-56-180.png     PNG File image-2024-01-07-02-30-57-665.png    
Issue Links:
Related
is related to KAFKA-320 Support setting a custom delete write... Closed
Documentation Changes: Not Needed

 Description   

Hello team,

we are configuring a mongo sink connector using confluent.

My settings were perfect as written in the docs, but only Insert and Update worked, but Delete did not work.

To create the DeleteOneWrite model,

"document.id.strategy" was set to PartialKeyStrategy and allowlist.

Of course "delete.on.null.values" : true ;
 "delete.writemodel.strategy" is the default value, DeleteOneDefaultStrategy
But it failed to handle the tombstone event and I found the following bug in MongoSinkTopicConfig:

As mentioned in the docs, with the id strategy to create DeleteOneModel

FullKeyStrategy, PartialKeyStrategy, ProvidedInKeyStrategy

You must create a DeleteOneDefaultStrategy object in one of three ways, but
We discovered something impossible during the current validation process.

Below is the code.

1. DELETE_WRITEMODEL_STRATEGY_CONFIG must be empty to create with 3 id strategies

 

2. Could not input "" because of Validators.matching(FULLY_QUALIFIED_CLASS_NAME)

 

3. DELETE_WRITEMODEL_STRATEGY_CONFIG cannot be empty because a default value exists.

 

Thank you.



 Comments   
Comment by Githook User [ 16/Jan/24 ]

Author:

{'name': 'tlsdnwn55', 'email': 'tlsdnwn55@naver.com', 'username': 'tlsdnwn55'}

Message: Fix custom Delete write model strategy support

KAFKA-395

Co-authored-by: Ross Lawley <ross@mongodb.com>
Branch: master
https://github.com/mongodb/mongo-kafka/commit/b2e00f4a9d59b069bb436449ce2d35cdb30c2c91

Comment by WooJoo Shin [ 07/Jan/24 ]

I wrote a PR about this. link KAFKA-395

Comment by PM Bot [ 06/Jan/24 ]

Hi tlsdnwn55@naver.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:06:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.