Skip to content

Commit

Permalink
mongodb cdc hotfix (#17)
Browse files Browse the repository at this point in the history
* [mongodb][hotfix] Fix authentication failed when using a non admin auth source and duplicated usernames apache#1934 (apache#1935)

* [hotfix][mongodb] Fix resume token not found apache#1879 (apache#1938)

---------

Co-authored-by: Jiabao Sun <jiabao.sun@xtransfer.cn>
  • Loading branch information
vanliu-tx and Jiabao-Sun authored Mar 22, 2023
1 parent 8649e55 commit fdea66d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flink-connector-mongodb-cdc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ under the License.
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.3.1</version>
<version>4.3.4</version>
</dependency>

<!-- test dependencies on Flink -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ public static TableChange collectionSchema(TableId tableId) {
@Override
public ChangeStreamOffset displayCurrentOffset(MongoDBSourceConfig sourceConfig) {
MongoClient mongoClient = clientFor(sourceConfig);
BsonDocument startupResumeToken =
getLatestResumeToken(mongoClient, ChangeStreamDescriptor.deployment());
CollectionDiscoveryInfo discoveryInfo = discoverAndCacheDataCollections(sourceConfig);
ChangeStreamDescriptor changeStreamDescriptor =
getChangeStreamDescriptor(
sourceConfig,
discoveryInfo.getDiscoveredDatabases(),
discoveryInfo.getDiscoveredCollections());
BsonDocument startupResumeToken = getLatestResumeToken(mongoClient, changeStreamDescriptor);

ChangeStreamOffset changeStreamOffset;
if (startupResumeToken != null) {
Expand Down

0 comments on commit fdea66d

Please sign in to comment.