{"action":"created","issue":{"url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/24","labels_url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/24/comments","events_url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/24/events","html_url":"https://github.com/shortdudey123/chef-gluster/pull/24","id":101391101,"number":24,"title":"Fix for Replicated and Distributed Replicated and peer probe check","user":{"login":"Seth-Karlo","id":10834938,"avatar_url":"https://avatars.githubusercontent.com/u/10834938?v=3","gravatar_id":"","url":"https://api.github.com/users/Seth-Karlo","html_url":"https://github.com/Seth-Karlo","followers_url":"https://api.github.com/users/Seth-Karlo/followers","following_url":"https://api.github.com/users/Seth-Karlo/following{/other_user}","gists_url":"https://api.github.com/users/Seth-Karlo/gists{/gist_id}","starred_url":"https://api.github.com/users/Seth-Karlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seth-Karlo/subscriptions","organizations_url":"https://api.github.com/users/Seth-Karlo/orgs","repos_url":"https://api.github.com/users/Seth-Karlo/repos","events_url":"https://api.github.com/users/Seth-Karlo/events{/privacy}","received_events_url":"https://api.github.com/users/Seth-Karlo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-17T10:32:45Z","updated_at":"2015-08-21T07:12:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shortdudey123/chef-gluster/pulls/24","html_url":"https://github.com/shortdudey123/chef-gluster/pull/24","diff_url":"https://github.com/shortdudey123/chef-gluster/pull/24.diff","patch_url":"https://github.com/shortdudey123/chef-gluster/pull/24.patch"},"body":"This fixes several issues when using multiple server/brick combinations.\r\n\r\n1. Before proceeding to the Volume create, an additional execute will run by default ten times with ten retries (set by attributes default['gluster']['server']['peer_wait_retries'] and default['gluster']['server']['peer_wait_retry_delay']) which will wait until the other peers are in the correct state. Setting these to 0 will disable the check.\r\n\r\n2. If someone would like a replicated volume, then this means a copy should be on every brick, so the replica count should equal the brick count. This PR means that if you use replicated, the replica count attribute will be ignored and the brick count will be used. Previously, if someone used 4 bricks and the defaults with replicated they would get a distributed-replicated volume. I also removed the bricks.first requirement for replicated volumes, as you can have multiple replicas on the same node if you really want to (in the case of stripe performance, I'll write the addition of those soon)\r\n\r\n3. Previously the check for distributed-replicated was checking the number of servers/nodes and multiplying this by the replica count, which means it is impossible to reach without multiple bricks on the same server (e.g: Replica count of 2 and 4 servers = 8 required bricks). Distributed-Replicated merely needs at least 2 times the number of bricks (note: not servers) than the replica count. This PR fixes this.\r\n\r\nFor example:\r\n2 servers with 2 bricks each with replicated = Replica count of 4, a copy on each brick.\r\n2 servers with 2 bricks each with dist-replicated and a replica count of 2 = 2 * 2 = 4 required bricks\r\n1 server with 4 bricks each with replicated = Replica count of 4, a copy on each brick\r\n8 servers with one brick each with a replica count of 2 = 2* 2 = 4, which is a multiple of 8.\r\n\r\n4. If you create multiple bricks on the same server, the command will ask your to press 'y' before proceeding. This fixes this too by checking if force = true.\r\n\r\nPlease let me know if I've made any foolish mistakes! I've tested this locally a few times now. Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/comments/133312668","html_url":"https://github.com/shortdudey123/chef-gluster/pull/24#issuecomment-133312668","issue_url":"https://api.github.com/repos/shortdudey123/chef-gluster/issues/24","id":133312668,"user":{"login":"Seth-Karlo","id":10834938,"avatar_url":"https://avatars.githubusercontent.com/u/10834938?v=3","gravatar_id":"","url":"https://api.github.com/users/Seth-Karlo","html_url":"https://github.com/Seth-Karlo","followers_url":"https://api.github.com/users/Seth-Karlo/followers","following_url":"https://api.github.com/users/Seth-Karlo/following{/other_user}","gists_url":"https://api.github.com/users/Seth-Karlo/gists{/gist_id}","starred_url":"https://api.github.com/users/Seth-Karlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seth-Karlo/subscriptions","organizations_url":"https://api.github.com/users/Seth-Karlo/orgs","repos_url":"https://api.github.com/users/Seth-Karlo/repos","events_url":"https://api.github.com/users/Seth-Karlo/events{/privacy}","received_events_url":"https://api.github.com/users/Seth-Karlo/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T07:12:47Z","updated_at":"2015-08-21T07:12:47Z","body":"How about we add a check that makes sure that if you have specified 'Replicated', you have to have at least 2 bricks and will otherwise skip the volume create? At the same time we have the warning that the replica count is not set correctly and is being ignored. Would this be ok with you?"}}