-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(mango): formatting of text bookmarks in _explain output
#5865
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
fix(mango): formatting of text bookmarks in _explain output
#5865
Conversation
|
_explain works for me without this patch; I do get this sometimes; which is a different bug. attempting to jiffy:encode a shard record. |
|
also the fixup code, if any is needed, should be in mango_cursor_text module, not the generic mango_cursor module. |
rnewson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as commented
Hrm, so may it be that simply |
|
It seems to me that we unpack the provided bookmark too early, in the |
|
( |
Excellent. I was suspecting that there may be other places where the missing conversion can be injected, but I was not sure. Thanks for checking. |
Yes, I also noticed this one. I am inclined to believe that it is a regression from the Elixir conversion (hence I am cc'ing @janl here) because the Python tests bailed out before any Search-based Mango tests could be run while the Elixir tests do not seem to care about that. A mitigation of the weird selection logic might be utilizing the |
I did not have problems with that. For the reference, once |
|
I'm using the |
Well, if Clouseau is run from source (basically) then it could indeed take more time because SBT will be called instead of running the JAR file immediately. That is the same for Clouseau 2.x too, but with Maven. |
5288a7a to
ab33399
Compare
In the Explain output, bookmarks for queries on `text` (Search) indexes are added in their unpacked format to the options. This leads to at least two problems: - it is inconsistent with how empty bookmarks are rendered for `json` indexes, where the string `"nil"` is used, - for non-trivial bookmarks, contents cannot be translated by `jiffy:encode/1` to a JSON representation so that it will crash. Mitigate this issue by deferring the unpacking of bookmarks to the execution phase so that explain will get affected by that. Thanks @mojito317 for reporting this issue, and thanks @rnewson for revisiting my original fix and guiding me about it.
ab33399 to
e9fa1ba
Compare
In the Explain output, bookmarks for queries on
text(Search) indexes are added in their unpacked format to the options. This leads to at least two problems:it is inconsistent with how empty bookmarks are rendered for
jsonindexes, where the string"nil"is used,for non-trivial bookmarks, contents cannot be translated by
jiffy:encode/1to a JSON representation so that it will crash.Mitigate this issue by deferring the unpacking of bookmarks to the execution phase so that explain will get affected by that.
Thanks @mojito317 for reporting this issue, and thanks @rnewson for revisiting my original fix and guiding me about it.
Testing recommendations
The change comes with tests that may be run as follows.
and
Otherwise just try to start a
_findquery on atextindex, grab the bookmark, and feed it into an_explainrequest with the same query. It should not crash any more. When running a_explainquery on atextwith no bookmark provided, theoptsfield in the body should shownilinstead of an empty array as it did previously.Checklist