Skip to content

Conversation

@katafrakt
Copy link
Contributor

The checkpoint file can be quite large (1.2G in my case) and it may take quite a while to load it (8.2s in my case). During that time, all the GenServer calls with the default timeout of 5000ms might timeout, leading to the whole GenServer termination and general instability of the search functionality.

This adds guards for state.loaded? which return {:error, :loading} if it's not loaded.

This addresses #303, probably only partially. I have more suspects of taking too long on a large project:

  • query_by_subject during delete (as described in Timeouts on querying search store #303)
  • reduce takes 2-3 seconds for my project
  • apply large WAL file - I once saw it grow to 17M, but I didn't manage to measure how long does it take to apply it

The checkpoint file can be quite large (1.2G in my case) and it may take
quite a while to load it (8.2s in my case). During that time, all the
GenServer calls with the default timeout of 5000ms might timeout,
leading to the whole GenServer termination and general instability of
the search functionality.

This adds guards for state.loaded? which return {:error, :loading} if
it's not loaded.
@mhanberg
Copy link
Member

What is the result of adding these error return values?

Does the editor display an error message?

@katafrakt
Copy link
Contributor Author

@mhanberg it is handled by the caller, like for example here:

    case Store.exact(subject, condition) do
      {:ok, entries} ->
        entries

      _ ->
        []
    end

One thing that could maybe be improved is to handle it inside call_or_default, but I'm not sure. What do you think?

Either way, it's not visible to the editor. Client just gets an empty result set (and rightly so, I think, it's not an error - search index is simply not available at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants