Skip to content

Commit

Permalink
[hotfix][mongodb] Fix resume token not found apache#1879 (apache#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiabao-Sun authored and Rawlings committed May 26, 2023
1 parent 1371f48 commit 2be5dc4
Showing 1 changed file with 7 additions and 2 deletions.
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 2be5dc4

Please sign in to comment.