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

Correction for objectID issue in last merge #86

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildGoModule {
pname = "oplogtoredis";
version = "3.7.0";
version = "3.7.1";
src = builtins.path { path = ./.; };

postInstall = ''
Expand Down
18 changes: 5 additions & 13 deletions lib/oplog/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,21 +510,13 @@ func (tailer *Tailer) parseRawOplogEntry(entry rawOplogEntry, txIdx *uint) []opl
} else {
idLookup := entry.Doc.Lookup("_id")
if idLookup.IsZero() {
log.Log.Errorf("failed to get objectId: _id is empty or not set")
log.Log.Error("failed to get objectId: _id is empty or not set")
return nil
}
oid, ok := idLookup.ObjectIDOK()
if ok {
// this is left as ObjectID type for now so it can be properly converted in processor.go:56
out.DocID = oid
} else {
oidString, ok := idLookup.StringValueOK()
if ok {
out.DocID = oidString
} else {
log.Log.Errorf("failed to get objectId: _id is not ObjectID or String type")
return nil
}
err := idLookup.Unmarshal(&out.DocID)
if err != nil {
log.Log.Errorf("failed to unmarshal objectId: %v", err)
return nil
}
}

Expand Down
Loading