Open klirichek opened 8 months ago
you need to start node with the --new-cluster
daemon cli to make sure the node will be leader after full cluster restart as described at Restarting a cluster
I can't reproduce it on my mac m1:
mysql> create cluster c;
--------------
create cluster c
--------------
ERROR 1064 (42000): failed to create desc: cluster 'c' already exists
mysql> exit
Writing history-file /Users/sn/.mysql_history
Bye
➜ ~ brew services restart manticoresearch-dev
Stopping `manticoresearch-dev`... (might take a while)
==> Successfully stopped `manticoresearch-dev` (label: homebrew.mxcl.manticoresearch-dev)
==> Successfully started `manticoresearch-dev` (label: homebrew.mxcl.manticoresearch-dev)
➜ ~ mysql -P9306 -h0 -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 6.2.13 6d36c68fb@240102 dev (columnar 2.2.5 1d1e432@231204) (secondary 2.2.5 1d1e432@231204) (knn 2.2.5 1d1e432@231204) git branch master...origin/master
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Reading history-file /Users/sn/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create cluster c;
--------------
create cluster c
--------------
ERROR 1064 (42000): failed to create desc: cluster 'c' already exists
mysql> show status like '%uptime%';
--------------
show status like '%uptime%'
--------------
+---------+-------+
| Counter | Value |
+---------+-------+
| uptime | 70 |
+---------+-------+
1 row in set (0.01 sec)
As discussed, Alexey will try to reproduce it again.
Updated. Reason was starting daemon second time without galera available. With galera simple (empty) cluster survives restart. However, cluster with nodes doesn't survive. May be it requires kind of manual massage and/or tons of startup options, however the fact that on 'simple restart' it disappears look not very friendly.
As discussed, what we can improve within this task is the reaction of the daemon to restarting it with an absent galera library by backing up the manticore.json
etc. As discussed, this is an easy task which shouldn't take long.
Describe the bug Empty cluster doesn't survive restart of the daemon
To Reproduce Steps to reproduce the behavior:
create cluster 'c'
Expected behavior State of clusters should be restored on restart. Notice, same vanishing happens when we join the cluster from another node. Despite the fact that cluster has no indexes on the moment on shutdown, that is not good that any info vanishes on restart, even if it is just a cluster's name.
UPDATE The behaviour is quite specific and locked to the case, when searchd starts second time not having galera library. That is: after cluster is created, and daemon stopped, it is second time started without galera, and as result - all related to cluster got lost in the config. I think, such edge-case behaviour is not so critical and ok (however, as proof-of-mistake it would be good to keep the data for future)
However, that is a bit more complicated scenario, where cluster dissapears:
1-st instance (in folder '1')
2-nd instance (in folder '2')
file 1/test_funcs
MRE scenario:
That produces output:
That is - cluster dissapears from config. However, with another scenario without join, it is stored.
MRE scenario: