-
Notifications
You must be signed in to change notification settings - Fork 106
Conversation
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.
LGTM, just a minor comment
Could someone merge or take a look? |
yeah this seems like a problem. is this still the case with this pr? |
Yes, still the case. There is no error response path for this function, so the signature would need to change and all callers would need to be updated to check for error |
@replay your thoughts? |
I think changing the index interface is the only option to avoid returning incomplete results. This will require updating quite a few places of code, but it won't be a complicated change. If we change the index interface anyway, then we should consider also passing a context into the index, so the index methods can be cancelled when f.e. the client closes the connection which is likely to happen before the default I would avoid panics in the index as much as possible, just to be sure that we never forget to unlock a lock |
@shanson7 do you want us to make this api change or will you do it? |
I can do it, but maybe not for a couple weeks. If one of you wants to do it earlier, just let me know. |
Looking into this more, returning an error is non-trivial. Some parts of the system use tag lookups internally (i.e. not from a user request context). In these cases, it is fairly important to propagate an error. However, most of the time the records are processed as a stream and the error can happen at any point during the stream processing. So, returning an error from Some examples of usage: idsByTagQuery - Callers pass in Metatags - used with idSelector - Also runs subqueries for metatags. Also async... |
I think making
This one is hard because we also need to decide what to do if a lookup by a method such as
if |
I think the "full" solution is too much effort for me at the moment. I still need a hard stop timeout (such as is provided this PR) to prevent issues with a locked index. |
ok, so then here's what i suggest: in the configs, in the comments above the setting. we say it's an experimental feature and that we have this known limitation. we also set it to default to 0 everywhere and make sure that 0 disables the feature. those who want the feature can then opt-in, and be aware of the limitation. |
Makes sense to me |
@Dieterbe - Ready for another review when you get the chance |
see #1944 |
Fixes #1870
IMO, the failing of this change is that it will return a partial response instead of an error. Alternative options are to refactor to return errors from
TagQueryContext.Run()
or to panic.