Summary
Bleve index (re-) creation fails in MM 7.3.0 with PostgreSQL backend.
Steps to reproduce
- List item Use a MM 7.3.0 (not sure if it is related to that version) with some amount of Posts.
- Purge any existing Bleve index
- Create a new index
- After running for a while the indexing stops and shows an error (see below)
Expected behavior
The index creation should finish without error.
Observed behavior
We just migrated our MM installation from MySQL to PostgreSQL as database backend.
Everything worked fine.
However, we weren’t sure if our Bleve index was up-to-date and thus first purged it and then tried to recreate it in the System Console Bleve section.
Index creation always fails after a while as you can see in the screen shot:
The PostgreSQL log shows repeated entries like this:
2022-10-08 17:25:55.862 CEST [12552] mattermost@mattermost_z43 ERROR: canceling statement due to user request
2022-10-08 17:25:55.862 CEST [12552] mattermost@mattermost_z43 STATEMENT: SELECT
PostsQuery.*, Channels.TeamId
FROM (
SELECT
*
FROM
Posts
WHERE
Posts.CreateAt > $1
OR
(Posts.CreateAt = $2 AND Posts.Id > $3)
ORDER BY
CreateAt ASC, Id ASC
LIMIT
$4
)
AS
PostsQuery
LEFT JOIN
Channels
ON
PostsQuery.ChannelId = Channels.Id
ORDER BY CreateAt ASC, Id ASC
2022-10-08 17:25:55.862 CEST [12552] mattermost@mattermost_z43 LOG: disconnection: session time: 0:00:34.738 user=mattermost database=mattermost_z43 host=::1 port=44801
202
This happened one two different MM instances, one migrated from MySQL to PostgreSQL in MM version 7.3.0 and another one migrated from MySQL to PostgreSQL in MM version 5.39.3 and upgraded to 7.3.0 afterwards. Identical failures on both systemd.