{"action":"closed","issue":{"url":"https://api.github.com/repos/pat/thinking-sphinx/issues/943","labels_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/943/labels{/name}","comments_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/943/comments","events_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/943/events","html_url":"https://github.com/pat/thinking-sphinx/issues/943","id":103803545,"number":943,"title":"preload_indices is not thread safe","user":{"login":"madmax","id":4486,"avatar_url":"https://avatars.githubusercontent.com/u/4486?v=3","gravatar_id":"","url":"https://api.github.com/users/madmax","html_url":"https://github.com/madmax","followers_url":"https://api.github.com/users/madmax/followers","following_url":"https://api.github.com/users/madmax/following{/other_user}","gists_url":"https://api.github.com/users/madmax/gists{/gist_id}","starred_url":"https://api.github.com/users/madmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madmax/subscriptions","organizations_url":"https://api.github.com/users/madmax/orgs","repos_url":"https://api.github.com/users/madmax/repos","events_url":"https://api.github.com/users/madmax/events{/privacy}","received_events_url":"https://api.github.com/users/madmax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T22:06:26Z","updated_at":"2015-11-19T16:10:15Z","closed_at":"2015-11-19T16:10:15Z","body":"Thinking sphinx should load all indexes when boot application but it don't load distributed indexes. \r\n\r\nIt means we have 1 instance of configuration shared across threads with preload_indices == false\r\n\r\nIf 2 threads want upgrade index (for example real time index) at the same time we might have race conditions with preload_indices method. \r\n\r\nAt the end we can have distributed indexes loaded twice with mean we have difrend document_id_for_key and this generates duplications \r\n\r\nexample: http://mad.xan.pl/s/9vjTiKjGq2/\r\n\r\n- We should load all indexes before we start threads\r\n- It will be nice to have some sort controll how document_id_for_key is generated because currently if we add new index we need reindex everything (for real time index it might be long time). If it will be possible to specify somewere in config number of supported indexes (we can then give bigger number there and have some space to add new indexes without reindexing everything). \r\n\r\n\r\n"}}