Hi Sebastian, how do we persist Lucene data when Squidex is running on a docker container? The CMS is deployed in GKE and everytime the pod restarts we get nothing from search queries
Hi, The lucene index is stored in the asset store and then extracted to the temp folder. This was the only solution I found that would work with kubernetes.
Hi, @Sebastian. Is this still the current solution?
Yes, it is stored in the assets. In the meantime I tried other solutions, but this is the fastest.
Why do you ask?
Tks for reply. I’ve made this question because I’m facing a similar problem (using AKS). There is no errors in logs so I’m investigating a possible problem with docker volume.
Just use S3 as asset storage…
I’m analyzing the code where the temp folder is deleted. When removing the
IF block, Lucene data is no longer removed and the search continues to work even after an deploy. I’m trying to understand this part better and why this deletion is always done in the first search after running the application.
The lucene indexes are implemented as an actor. An actor is a stateful instance that is distributed across a Squidex cluster by Orleans (https://dotnet.github.io/orleans/Documentation/index.html).
Each app has their own actor for full text search.
It is like a set of microservices living inside Squidex. When you have multiple nodes and one node goes down, is restarted or a new version is deployed the actors on this node are destroyed and recreated when needed either on the same machine or one of the other machines.
Therefore an index can move from machine A to machine B and back to machine A and we cannot store the indexes in the file system of the machine. Therefore they are stored in the asset storage, which could be a file system but is usually S3 bucket or any other cloud storage.
After this transition A->B->A, the index in the temp folder on A might be stale, but I don’t know it. Therefore I delete it and download the newer version from the asset store.
Tks for quick and complete response.
The point is: The full text search uses the same storage as the assets. You want to have it fixed anyway in your deployment. Otherwise you will loose your assets as well.