{"action":"created","issue":{"url":"https://api.github.com/repos/basho/machi/issues/39","labels_url":"https://api.github.com/repos/basho/machi/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/basho/machi/issues/39/comments","events_url":"https://api.github.com/repos/basho/machi/issues/39/events","html_url":"https://github.com/basho/machi/issues/39","id":114557966,"number":39,"title":"{error, written} handling in cr client when writing","user":{"login":"shino","id":10225,"avatar_url":"https://avatars.githubusercontent.com/u/10225?v=3","gravatar_id":"","url":"https://api.github.com/users/shino","html_url":"https://github.com/shino","followers_url":"https://api.github.com/users/shino/followers","following_url":"https://api.github.com/users/shino/following{/other_user}","gists_url":"https://api.github.com/users/shino/gists{/gist_id}","starred_url":"https://api.github.com/users/shino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shino/subscriptions","organizations_url":"https://api.github.com/users/shino/orgs","repos_url":"https://api.github.com/users/shino/repos","events_url":"https://api.github.com/users/shino/events{/privacy}","received_events_url":"https://api.github.com/users/shino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-02T09:31:12Z","updated_at":"2015-11-04T06:54:01Z","closed_at":null,"body":"Spin off from #33 .\r\n\r\n> For the first one `bad_return_value`, quick fix is at 903e939, just reply tag missing for handle_call return. I will create another PR with small eunit unless too difficult\r\n\r\nSuperficial reason of `bad_return_value` is reply tag as explained by quick fix [1].\r\nBut it seems like the root cause is double write as other two errors found.\r\n\r\n`bad_return_value` was occurred in call from `do_append_midtail2` to\r\n`do_repair_chunk` in `machi_cr_client`. The current code triggers\r\nrepair by `{error, written}` [2] but FLU returns ok when \"correct\" chunk\r\nis written [3].\r\n\r\nThe quick fix [1] will hide conflict in data and probably returns false ok.\r\n\r\n[1] https://github.com/basho/machi/commit/903e9395c8a32af8ae7440ab8d0fb4d170c93cfd\r\n[2] https://github.com/basho/machi/blob/master/src/machi_cr_client.erl#L434\r\n[3] https://github.com/basho/machi/blob/master/src/machi_file_proxy.erl#L683-L696\r\n"},"comment":{"url":"https://api.github.com/repos/basho/machi/issues/comments/153605247","html_url":"https://github.com/basho/machi/issues/39#issuecomment-153605247","issue_url":"https://api.github.com/repos/basho/machi/issues/39","id":153605247,"user":{"login":"shino","id":10225,"avatar_url":"https://avatars.githubusercontent.com/u/10225?v=3","gravatar_id":"","url":"https://api.github.com/users/shino","html_url":"https://github.com/shino","followers_url":"https://api.github.com/users/shino/followers","following_url":"https://api.github.com/users/shino/following{/other_user}","gists_url":"https://api.github.com/users/shino/gists{/gist_id}","starred_url":"https://api.github.com/users/shino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shino/subscriptions","organizations_url":"https://api.github.com/users/shino/orgs","repos_url":"https://api.github.com/users/shino/repos","events_url":"https://api.github.com/users/shino/events{/privacy}","received_events_url":"https://api.github.com/users/shino/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T06:54:01Z","updated_at":"2015-11-04T06:54:01Z","body":"What I want to confirm/settle down first is what `{error, written}` means.\r\nCurrent FLU server side implementation, it is used in response to append/write requests to indicate \"already different bytes are written\". CR client code seems to consider it as \"write attempts to midtails are already dome *with the bytes I want to write* by someone else, e.g. repair\". Is it better to use different error atom to indicate two cases?"}}