{"action":"created","issue":{"url":"https://api.github.com/repos/tarantool/tarantool/issues/1063","labels_url":"https://api.github.com/repos/tarantool/tarantool/issues/1063/labels{/name}","comments_url":"https://api.github.com/repos/tarantool/tarantool/issues/1063/comments","events_url":"https://api.github.com/repos/tarantool/tarantool/issues/1063/events","html_url":"https://github.com/tarantool/tarantool/issues/1063","id":108117610,"number":1063,"title":"WAL delayed commit","user":{"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},"labels":[{"url":"https://api.github.com/repos/tarantool/tarantool/labels/bsync","name":"bsync","color":"009800"},{"url":"https://api.github.com/repos/tarantool/tarantool/labels/feature","name":"feature","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-24T12:04:06Z","updated_at":"2015-09-24T12:05:41Z","closed_at":null,"body":"Synchronous replication implement two-phase commit protocol:\r\n\r\n1. Requests are written to xlogs on master and slaves\r\n2. Slaves sent confirmation to master\r\n3. Master replies to slaves with COMMIT on success /  ROLLBACK on failure response\r\n4. Slaves marks transaction in WAL as committed / rolled back\r\n\r\nThe principal difference with the current scheme is that WAL now can contains unconfirmed (uncommitted) transactions. Please note that master **doesn't wait until current transaction is finished on slaves before sending next transactions to slaves**. In other words, a send queue is multiplexed like WAL. Master can distribute new transaction and confirm old with the same packet (i.e. piggy back). xlog file never truncates or removes rows that were rolled back.\r\n\r\n### How it was done\r\n\r\nAnton added two new members to xrow_header: `commin_sn` and `rollback_sn` in his bsync branch. `commit_sn` / `rollback_sn` is vclock_signature of the last record that must be committed / rolled back.\r\n \r\nSince commit/rollback message is not attached to any particual row, Anton re-invented a special explicit NO-OP message that processed by internally by recovery and ignored by box::recovery_row. This operation has empty body and doesn't have `IPROTO_CODE` member. \r\n\r\n### How it should be done\r\n\r\n1. Add a special iproto code for `COMMIT`/`ROLLBACK` operation. This code will be used internally by recovery.\r\n2. Allow `commit_sn` and `rollback_sn` in any request to reduce the xlog sizes.\r\n3. In 1.6.x add `commit_sn` with the signature of previous row to the next row.\r\nThis is like xlog check sum that we planned to add a long time ago. **Ignore them for now.** This change will make 1.6 compatible with 1.7.\r\n4. In 1.7.x to queue all rows during recovery until receiving commit/rollback. The patch is already exists in bsync branch.\r\n\r\nPlease note that 1.6 will be compatible with 1.6 if we add commit_sn to all transactions and ask users to upgrade to the latest 1.6 before switching to 1.7.\r\n"},"comment":{"url":"https://api.github.com/repos/tarantool/tarantool/issues/comments/142910863","html_url":"https://github.com/tarantool/tarantool/issues/1063#issuecomment-142910863","issue_url":"https://api.github.com/repos/tarantool/tarantool/issues/1063","id":142910863,"user":{"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},"created_at":"2015-09-24T12:05:41Z","updated_at":"2015-09-24T12:05:41Z","body":"This patch will fix #1051 - Wal_write_to_disk should stop using ftruncate"}}