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

Meerkat-0.014 build failing due to deprecated MongoDB::Client calls #17

Closed
toddbruner opened this issue Dec 7, 2016 · 2 comments
Closed

Comments

@toddbruner
Copy link
Contributor

Build log attached
meerkat.build.log.txt

follows:

@toddbruner
Copy link
Contributor Author

toddbruner commented Dec 7, 2016

Dan: I'm willing to put some effort into fixing, but I'm afraid I'm unsure how to translate the deprecated calls into the new form. Namely, can the deprecation warning suggestions be trusted?

E.g.,

# # The 'save' method will be removed in a future major release.
  # # Use 'replace_one' with upsert instead.
  # #    MongoDB::Collection::save called at /home/scot/.cpanm/work/1481142009.116534/Meerkat-0.014/blib/lib/Meerkat/Collection.pm line 330`

When I look at Collection.pm:330 I see:

return $self->_try_mongo_op( sync => sub { !!$self->_mongo_collection->save($pack) }

Looking at the MongoDB::Collection documentation I see replace_one, so would it be as simple as:

return $self->_try_mongo_op( sync => sub { !!$self->_mongo_collection->replace_one($pack, {upsert => 1})

EDIT:

I've done some initial trials but the changes seem to be more elaborate behind the scenes and I haven't got the tests in basic.t to pass yet. I want to continue to use Meerkat, so I'll keep plinking at it, but would appreciate any help or guidance you can provide on how to move forward with the new MongoDB client changes.

Thanks,

@xdg
Copy link
Contributor

xdg commented Dec 8, 2016

Thanks for reminding me of the deprecation warnings. I'll tackle the deprecation warnings within the next week. Longer term, "save" and 'replace_one' have race conditions and I need to think about how to add a "safe" mode that does a two-phase commit or optimistic concurrency control or something like that.

@xdg xdg closed this as completed in 3015cc9 Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants