{"action":"closed","issue":{"url":"https://api.github.com/repos/tarantool/tarantool/issues/808","labels_url":"https://api.github.com/repos/tarantool/tarantool/issues/808/labels{/name}","comments_url":"https://api.github.com/repos/tarantool/tarantool/issues/808/comments","events_url":"https://api.github.com/repos/tarantool/tarantool/issues/808/events","html_url":"https://github.com/tarantool/tarantool/issues/808","id":70382431,"number":808,"title":"use inotify to speed up WAL delivery in async replication","user":{"login":"kostja","id":482910,"avatar_url":"https://avatars.githubusercontent.com/u/482910?v=3","gravatar_id":"","url":"https://api.github.com/users/kostja","html_url":"https://github.com/kostja","followers_url":"https://api.github.com/users/kostja/followers","following_url":"https://api.github.com/users/kostja/following{/other_user}","gists_url":"https://api.github.com/users/kostja/gists{/gist_id}","starred_url":"https://api.github.com/users/kostja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostja/subscriptions","organizations_url":"https://api.github.com/users/kostja/orgs","repos_url":"https://api.github.com/users/kostja/repos","events_url":"https://api.github.com/users/kostja/events{/privacy}","received_events_url":"https://api.github.com/users/kostja/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tarantool/tarantool/labels/bug","name":"bug","color":"eb6420"},{"url":"https://api.github.com/repos/tarantool/tarantool/labels/review","name":"review","color":"fad8c7"}],"state":"closed","locked":false,"assignee":{"login":"rtsisyk","id":1799054,"avatar_url":"https://avatars.githubusercontent.com/u/1799054?v=3","gravatar_id":"","url":"https://api.github.com/users/rtsisyk","html_url":"https://github.com/rtsisyk","followers_url":"https://api.github.com/users/rtsisyk/followers","following_url":"https://api.github.com/users/rtsisyk/following{/other_user}","gists_url":"https://api.github.com/users/rtsisyk/gists{/gist_id}","starred_url":"https://api.github.com/users/rtsisyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtsisyk/subscriptions","organizations_url":"https://api.github.com/users/rtsisyk/orgs","repos_url":"https://api.github.com/users/rtsisyk/repos","events_url":"https://api.github.com/users/rtsisyk/events{/privacy}","received_events_url":"https://api.github.com/users/rtsisyk/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/tarantool/tarantool/milestones/9","html_url":"https://github.com/tarantool/tarantool/milestones/1.6.6","labels_url":"https://api.github.com/repos/tarantool/tarantool/milestones/9/labels","id":726922,"number":9,"title":"1.6.6","description":"Gamma","creator":{"login":"kostja","id":482910,"avatar_url":"https://avatars.githubusercontent.com/u/482910?v=3","gravatar_id":"","url":"https://api.github.com/users/kostja","html_url":"https://github.com/kostja","followers_url":"https://api.github.com/users/kostja/followers","following_url":"https://api.github.com/users/kostja/following{/other_user}","gists_url":"https://api.github.com/users/kostja/gists{/gist_id}","starred_url":"https://api.github.com/users/kostja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostja/subscriptions","organizations_url":"https://api.github.com/users/kostja/orgs","repos_url":"https://api.github.com/users/kostja/repos","events_url":"https://api.github.com/users/kostja/events{/privacy}","received_events_url":"https://api.github.com/users/kostja/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":25,"state":"open","created_at":"2014-07-21T09:38:49Z","updated_at":"2015-05-28T22:02:30Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-04-23T11:14:41Z","updated_at":"2015-05-28T22:02:30Z","closed_at":"2015-05-28T22:02:30Z","body":"Right now replication thread uses ev_stat watcher to discover changes in the binary log and relay them to a replica. ev_stat watcher uses second-coarse timer resolution, which means that a replica may be tens of thousands of records behind the master. This is too much. Additionally, 10 times per second the replica thread rescans the WAL directory to find new data. This is ugly. Additionally,  there is a race condition in notification process when changing the current WAL: if the relay is busy reading the current WAL while a new WAL is being created, it will not notice inotify event for the new WAL and yield into sleep. \r\n\r\nTo solve these issues, we need:\r\n- a native inotify watcher which resumes a fiber whenever any inotify event occurs, instead of built-in libev ev_stat watcher\r\n- we should never suspend this watcher, even when re-reading the WAL (currently we only activate the watcher while sleeping, which opens a window for race condition)."}}