Manticore in docker not loading plain tables after sighup #1128
-
I am looking for help with manticore running in docker. Essentially I cannot seem to get it to pick up plain tables without a restart of the entire container. I thought that it should pick them up if I send a SIGHUP to the container (and the indexer seems to do it but I dont see the table) Perhaps I am doing something incorrectly (or my understanding is wrong) My work flow is roughly this.
$ sudo docker compose exec -T manticore-container gosu manticore indexer --rotate table_1
Manticore 6.0.4 1a3a4ea82@230314
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
using config file '/etc/manticoresearch/manticore.conf'...
indexing table 'table_1'...
collected 1912288 docs, 504.7 MB
creating lookup: 1912.2 Kdocs, 100.0% done
sorted 74.3 Mhits, 100.0% done
total 1912288 docs, 504723046 bytes
total 288.155 sec, 1751566 bytes/sec, 6636.31 docs/sec
total 92 reads, 0.193 sec, 4817.5 kb/call avg, 2.0 msec/call avg
total 4679 writes, 2.242 sec, 377.0 kb/call avg, 0.4 msec/call avg
rotating tables: successfully sent SIGHUP to searchd (pid=1).
$ sudo docker compose exec -it manticore-container mysql
mysql> SHOW TABLES;
+--------------------+-------------+
| Index | Type |
+--------------------+-------------+
| table_rt | distributed |
| table_rt_0 | rt |
| table_rt_1 | rt |
| table_rt_2 | rt |
+--------------------+-------------+ So the Even if I send the container a sighup directly with $ sudo docker compose kill -s SIGHUP manticore-container However if I restart the container it appears $ sudo docker compose restart manticore-container
$ sudo docker compose exec -it manticore-container mysql
mysql> SHOW TABLES;
+--------------------+-------------+
| Index | Type |
+--------------------+-------------+
| table_1 | local |
| table_rt | distributed |
| table_rt_0 | rt |
| table_rt_1 | rt |
| table_rt_2 | rt |
+--------------------+-------------+ and then I can use Is the searchd not getting the SIGHUP for some reason or is my understanding incorrect? edit: I can see in the logs that it is getting the sighup however it reports nothing to rotate
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You may have to use
while
MREsnikolaev@dev2:~$ cat csv_min_abs_path.conf
searchd {
listen = 0.0.0.0:9306:mysql
log = searchd.log
pid_file = searchd.pid
binlog_path =
}
source src {
type = csvpipe
csvpipe_command = echo "1,abc" && echo "2,abc" && echo "3,abc abc"
csvpipe_field = f
}
index idx {
type = plain
source = src
path = /var/lib/manticore/idx
stored_fields = f
}
snikolaev@dev2:~$ docker run --rm -e EXTRA=1 --name manticore -v $(pwd)/data/:/var/lib/manticore/ -v $(pwd)/csv_min_abs_path.conf:/etc/manticoresearch/manticore.conf -p 127.0.0.1:9315:9306 -d manticoresearch/manticore
89c1470bfbb2b3a1188d48e6f9afd11e9c462bdcb43445be080fb0c849e6554b
snikolaev@dev2:~$ mysql -P9315 -h0 -e "show tables"
snikolaev@dev2:~$
# i.e. no tables yet
snikolaev@dev2:~$ docker exec -it manticore gosu manticore indexer --all --rotate
Manticore 6.0.4 1a3a4ea82@230314 (columnar 2.0.4 5a49bd7@230306) (secondary 2.0.4 5a49bd7@230306)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
using config file '/etc/manticoresearch/manticore.conf'...
indexing table 'idx'...
collected 3 docs, 0.0 MB
creating secondary index
creating lookup: 0.0 Kdocs, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 3 docs, 13 bytes
total 0.078 sec, 166 bytes/sec, 38.39 docs/sec
total 3 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 15 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
rotating tables: successfully sent SIGHUP to searchd (pid=1).
snikolaev@dev2:~$ mysql -P9315 -h0 -e "show tables"
snikolaev@dev2:~$
# still not tables after building the index
snikolaev@dev2:~$ mysql -P9315 -h0 -e "reload tables"
snikolaev@dev2:~$ mysql -P9315 -h0 -e "show tables"
+-------+-------+
| Index | Type |
+-------+-------+
| idx | local |
+-------+-------+ |
Beta Was this translation helpful? Give feedback.
You may have to use
RELOAD TABLES
in case a table doesn't exist all at the moment when the searchd starts and is built afterwards. When Manticore receives just HUP it's like "oh, I don't have any tables, so I'm just skipping" which looks like this in the log:while
RELOAD TABLES
would result in: