Turbo Indexer Log, PID and Chunk Files

What each file in /tmp is, and when it goes away

Files and logs

Every session keeps its files in /tmp, named with a session key: the server's machine name, or server and index joined by two underscores for a run with --index.

drush ost --server=my_solr_server     # key: my_solr_server
drush ost --index=content_index       # key: my_solr_server__content_index

Without --server, the server part is the first enabled Solr server.

/tmp/opensolr_turbo_{key}.log

Everything a background run prints. Never removed by the indexer; each run adds to the end.

/tmp/opensolr_turbo_{key}_master.pid

The process ID of the session's main process. Removed when the run ends or drush osstop stops it.

/tmp/opensolr_turbo_{key}.pids

The process IDs of the current round's workers. Removed at the same moments.

/tmp/opensolr_turbo_{key}_state.json

The session's server and index, which drush oss reads. Removed at the same moments.

/tmp/opensolr_chunks_{key}/

One chunk file per worker, holding the item IDs of its batch. The files go after each round; the folder stays.

Versions older than 2.5 used a single /tmp/opensolr_turbo_master.pid. drush osstop stops a process it finds there and removes the file.

Handy commands

# Follow a run live
tail -f /tmp/opensolr_turbo_my_solr_server.log

# The last 100 lines
tail -n 100 /tmp/opensolr_turbo_my_solr_server.log

# Worker errors
grep 'OpenSolr Worker' /tmp/opensolr_turbo_my_solr_server.log

# Sessions that have a main process file
ls /tmp/opensolr_turbo_*_master.pid

Cleaning up

drush osstop removes the process ID, state and chunk files of the sessions it stops. Logs and empty chunk folders stay. Delete them when nothing runs:

rm -f /tmp/opensolr_turbo_*.log
rm -rf /tmp/opensolr_chunks_*
Only between runs
Move or delete a log only when its session is not running. A running process keeps writing to the file it opened.

Reference