summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
Commit message (Collapse)AuthorAgeFilesLines
* rpc/socket: Close pipe on disconnectionKaushal M2016-10-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Encrypted connections create a pipe, which isn't closed when the connection disconnects. This leaks fds, and gluster eventually ends up in a situation with fd starvation which leads to operation failures. > Change-Id: I144e1f767cec8c6fc1aa46b00cd234129d2a4adc > BUG: 1336371 > Signed-off-by: Kaushal M <kaushal@redhat.com> > Reviewed-on: http://review.gluster.org/14356 > Tested-by: MOHIT AGRAWAL <moagrawa@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I144e1f767cec8c6fc1aa46b00cd234129d2a4adc BUG: 1336369 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/15704 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: lidi <lidi@estor.com.cn> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* socket: log the client identifier in ssl connectRaghavendra Bhat2016-08-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Backport of commit d308fb5e152d8c908bf4f5da81f553fbe3d0400a > Change-Id: I4b463ecafb66de16cbe7ed23fae800bb1204f829 > BUG: 1333912 > Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> > Reviewed-on: http://review.gluster.org/14242 > Tested-by: Vijay Bellur <vbellur@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> > (cherry picked from commit d308fb5e152d8c908bf4f5da81f553fbe3d0400a) Change-Id: I2a57a206edab3e0c05ce28c299d78264c9a33d8b BUG: 1351933 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Reviewed-on: http://review.gluster.org/14844 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* rpc/socket: pthread resources are not cleaned upN Balachandran2016-07-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A socket_connect failure creates a new pthread which is not a detached thread. As no pthread_join is called, the thread resources are not cleaned up causing a memory leak. Now, socket_connect creates a detached thread to handle failure. > Change-Id: Idbf25d312f91464ae20c97d501b628bfdec7cf0c > BUG: 1343374 > Signed-off-by: N Balachandran <nbalacha@redhat.com> > Reviewed-on: http://review.gluster.org/14875 > Smoke: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> (cherry picked from commit 9886d568a7a8839bf3acc81cb1111fa372ac5270) Change-Id: If0a65c50fef2a32148cf3a1d7992e63f044bf0ad BUG: 1360553 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/15019 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* rpc/socket.c : Modify socket_poller code in case of ENODATA error code.Mohit Agrawal2016-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Polling failure errors are coming till volume is not come while SSL is enabled. Solution: To avoid the message update one condition in socket_poller code It will not exit from thread in case of received ENODATA from ssl_do function. Backport of commit 84e9fc2fb5fabf9d1e553a420854a306cdb8a168 > Change-Id: Ia514e99b279b07b372ee950f4368ac0d9c702d82 > BUG: 1349709 > Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> > Reviewed-on: http://review.gluster.org/14786 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> > (cherry picked from commit 84e9fc2fb5fabf9d1e553a420854a306cdb8a168) BUG: 1359651 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Change-Id: I86aa9955eca13d23120ba17b787f619c7de6be0c Reviewed-on: http://review.gluster.org/14998 Tested-by: MOHIT AGRAWAL <moagrawa@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* rpc/socket.c: Modify approach to cleanup threads of socket_poller in ↵Mohit Agrawal2016-07-261-142/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | socket_spawn. Problem: Current approach to cleanup threads of socket_poller is not appropriate. Solution: Enable detach flag at the time of thread creation in socket_spawn. Fix: Write a new wrapper(gf_create_detach_thread) to create detachable thread instead of store thread ids in a queue. Test: Fix is verfied on gluster process, To test the patch followed below procedure Enable the client.ssl and server.ssl option on the volume Start the volume and count anon segment in pmap output for glusterd process pmap -x <glusterd-pid> | grep "\[ anon \]" | wc -l Stop the volume and check again count of anon segment it should not increase. Backport of commit 2ee48474be32f6ead2f3834677fee89d88348382 > Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> > Change-Id: Ib8f7ec7504ec8f6f74b45ce6719b6fb47f9fdc37 > BUG: 1336508 > Reviewed-on: http://review.gluster.org/14694 > Smoke: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> BUG: 1354394 Change-Id: I271e83e7a210ecd27a7471c53147ceb837a33cad Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Reviewed-on: http://review.gluster.org/14886 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* rpc: invalid argument when function setsockopt sets option TCP_USER_TIMEOUTNiels de Vos2016-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | If option "transport.tcp-user-timeout" hasn't been setted, glusterd's priv->timeout will be -1, which will cause invalid argument when set TCP_USER_TIMEOUT. Cherry picked from commit b2c73cbf423de6201f956f522b7429615c88869d: > Change-Id: Ibc16264ceac0e69ab4a217ffa27c549b9fa21df9 > BUG: 1349657 > Signed-off-by: Zhou Zhengping <johnzzpcrystal@gmail.com> > Reviewed-on: http://review.gluster.org/14785 > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Change-Id: Ibc16264ceac0e69ab4a217ffa27c549b9fa21df9 BUG: 1354404 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/14889 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* rpc: change client insecure port ceiling from 65535 to 49151Prasanna Kumar Kalever2016-05-202-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | current port allocation to various processes (clumsy): 1023 - 1 -> client ports range if bind secure is turned on 49151 - 1024 -> fall back to this, if in above case ports exhaust 65535 - 1024 -> client port range if bind insecure is on 49152 - 65535 -> brick port range now, we have segregated port ranges 0 - 65535 to below 3 ranges 1023 - 1 -> client ports range if bind secure is turned on 49151 - 1024 -> client port range if bind insecure is on (fall back to this, if in above case ports exhaust) 49152 - 65535 -> brick port range so now we have a clean segregation of port mapping Backport of: > Change-Id: Ie3b4e7703e0bbeabbe0adbdd6c60d9ef78ef7c65 > BUG: 1335776 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> > Reviewed-on: http://review.gluster.org/14326 > Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> > Reviewed-by: Raghavendra Talur <rtalur@redhat.com> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Smoke: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: Ie3b4e7703e0bbeabbe0adbdd6c60d9ef78ef7c65 BUG: 1335813 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14412 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* socket: Fix incorrect handling of partial readsXavier Hernandez2016-05-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The usage of function local variables in the protocol state machine caused an incorrect behaviour when a partial read from the socket forced the function to return and restart later when more data was available. At this point the local variables contained incorrect data. > Change-Id: I4db1f4ef5c46a3d2d7f7c5328e906188c3af49e6 > BUG: 1334285 > Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> > Reviewed-on: http://review.gluster.org/14270 > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Tested-by: Raghavendra G <rgowdapp@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Change-Id: I0465969f27a38912a1b2cd50f5c8ae61bc782e8c BUG: 1331502 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/14292 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
* rpc: define client port rangePrasanna Kumar Kalever2016-05-042-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: when bind-insecure is 'off', all the clients bind to secure ports, if incase all the secure ports exhaust the client will no more bind to secure ports and tries gets a random port which is obviously insecure. we have seen the client obtaining a port number in the range 49152-65535 which are actually reserved as part of glusterd's pmap_registry for bricks, hence this will lead to port clashes between client and brick processes. Solution: If we can define different port ranges for clients incase where secure ports exhaust, we can avoid the maximum port clashes with in gluster processes. Still we are prone to have clashes with other non-gluster processes, but the chances being very low, but that's a different story on its own, which will be handled in upcoming patches. > Change-Id: Ib5ce05991aa1290ccb17f6f04ffd65caf411feaf > BUG: 1322805 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> > Reviewed-on: http://review.gluster.org/13998 > Smoke: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Change-Id: I712676d3e79145d78a17f2c361525e6ef82a4732 BUG: 1323564 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14205 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* rpc: assign port only if it is unreservedPrasanna Kumar Kalever2016-05-042-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current order: assign port; check for port; if reserved { port--; continue to i; } bind(); basically, we are assigning port first then checking if it is reserved Fix: get unreserved port; assign port; bind(); from now, we get unreserved port first and then assign it Backport of: > Change-Id: I004580c5215e7c9cae3594af6405b20fcd9fa4ad > BUG: 1323659 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> > Reviewed-on: http://review.gluster.org/13900 > Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Raghavendra Talur <rtalur@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Change-Id: I772c1323606f1853542e22d8ab4d80934871efcb BUG: 1332838 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14204 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* glusterd: add defence mechanism to avoid brick port clashesPrasanna Kumar Kalever2016-05-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intro: Currently glusterd maintain the portmap registry which contains ports that are free to use between 49152 - 65535, this registry is initialized once, and updated accordingly as an then when glusterd sees they are been used. Glusterd first checks for a port within the portmap registry and gets a FREE port marked in it, then checks if that port is currently free using a connect() function then passes it to brick process which have to bind on it. Problem: We see that there is a time gap between glusterd checking the port with connect() and brick process actually binding on it. In this time gap it could be so possible that any process would have occupied this port because of which brick will fail to bind and exit. Case 1: To avoid the gluster client process occupying the port supplied by glusterd : we have separated the client port map range with brick port map range more @ http://review.gluster.org/#/c/13998/ Case 2: (Handled by this patch) To avoid the other foreign process occupying the port supplied by glusterd : To handle above situation this patch implements a mechanism to return EADDRINUSE error code to glusterd, upon which a new port is allocated and try to restart the brick process with the newly allocated port. Note: Incase of glusterd restarts i.e. runner_run_nowait() there is no way to handle Case 2, becuase runner_run_nowait() will not wait to get the return/exit code of the executed command (brick process). Hence as of now in such case, we cannot know with what error the brick has failed to connect. This patch also fix the runner_end() to perform some cleanup w.r.t return values. Backport of: > Change-Id: Iec52e7f5d87ce938d173f8ef16aa77fd573f2c5e > BUG: 1322805 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> > Reviewed-on: http://review.gluster.org/14043 > Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Change-Id: Ief247b4d4538c1ca03e73aa31beb5fa99853afd6 BUG: 1323564 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14208 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* socket: Reap own-threadsKaushal M2016-05-032-0/+122
| | | | | | | | | | | | | | | | | | Backport of f8948e2 from master Dead own-threads are reaped periodically (currently every minute). This helps avoid memory being leaked, and should help prevent memory starvation issues with GlusterD. Change-Id: Ifb3442a91891b164655bb2aa72210b13cee31599 BUG: 1268125 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-originally-on: http://review.gluster.org/14101 Reviewed-on: http://review.gluster.org/14143 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* rpc: fix gf_process_reserved_portsPrasanna Kumar Kalever2016-05-022-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | this patch also does minor code cleanups. Backport of: > Change-Id: I0d005bd0f9baaaae498aa1df4faa6fcb65fa7a6e > BUG: 1198849 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> > Reviewed-on: http://review.gluster.org/13997 > Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Jeff Darcy <jdarcy@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Change-Id: Ia53ba724f6d31cb2fc609786e31a1b676f55fe01 BUG: 1331941 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14128 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
* Revert "glusterd: Bug fixes for IPv6 support"Kaushal M2016-04-161-5/+4
| | | | | | | | This reverts commit b33f3c95ec9c8112e6677e09cea05c4c462040d0. This commit exposes some issues with management encryption that prevents GlusterFS from operating properly. This will be added again once problems with management encryption are fixed.
* socket: Don't cleanup encrypted transport in socket_connect()Kaushal M2016-04-091-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ..instead cleanup only in socket_poller() Backport of be99ddd from master With commit d117466 socket_poller() wasn't launched from socket_connect (for encrypted connections), if connect() failed. This was done to prevent the socket private data from being double unreffed, from the cleanups in both socket_poller() and socket_connect(). This allowed future reconnects to happen successfully. If a socket reconnects is sort of decided by the rpc notify function registered. The above change worked with glusterd, as the glusterd rpc notify function (glusterd_peer_rpc_notify()) continuously allowed reconnects on failure. mgmt_rpc_notify(), the rpc notify function in glusterfsd, behaves differently. For a DISCONNECT event, if more volfile servers are available or if more addresses are available in the dns cache, it allows reconnects. If not it terminates the program. For a CONNECT event, it attempts to do a volfile fetch rpc request. If sending this rpc fails, it immediately terminates the program. One side effect of commit d117466, was that the encrypted socket was registered with epoll, unintentionally, on a connect failure. A weird thing happens because of this. The epoll notifier notifies mgmt_rpc_notify() of a CONNECT event, instead of a DISCONNECT as expected. This causes mgmt_rpc_notify() to attempt an unsuccessful volfile fetch rpc request, and terminate. (I still don't know why the epoll raises the CONNECT event) Commit 46bd29e fixed some issues with IPv6 in GlusterFS. This caused address resolution in GlusterFS to also request of IPv6 addresses (AF_UNSPEC) instead of just IPv4. On most systems, this causes the IPv6 addresses to be returned first. GlusterD listens on 0.0.0.0:24007 by default. While this attaches to all interfaces, it only listens on IPv4 addresses. GlusterFS daemons and bricks are given 'localhost' as the volfile server. This resolves to '::1' as the first address. When using management encryption, the above reasons cause the daemon processes to fail to fetch volfiles and terminate. Solution -------- The solution to this is simple. Instead of cleaning up the encrypted socket in socket_connect(), launch socket_poller() and let it cleanup the socket instead. This prevents the unintentional registration with epoll, and socket_poller() sends the correct events to the rpc notify functions, which allows proper reconnects to happen. Change-Id: Idb0c0a828743cccca51cfdd1aa6458cfa0a9d100 BUG: 1325491 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/13931 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
* glusterd: Bug fixes for IPv6 supportNithin D2016-03-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/#/c/11988/ Problem: Glusterd not working using ipv6 transport. The idea is with proper glusterd.vol configuration, 1. glusterd needs to listen on default port (240007) as IPv6 TCP listner. 2. Volume creation/deletion/mounting/add-bricks/delete-bricks/peer-probe needs to work using ipv6 addresses. 3. Bricks needs to listen on ipv6 addresses. All the above functionality is needed to say that glusterd supports ipv6 transport and this is broken. Fix: When "option transport.address-family inet6" option is present in glusterd.vol file, it is made sure that glusterd creates listeners using ipv6 sockets only and also the same information is saved inside brick volume files used by glusterfsd brick process when they are starting. Tests Run: Regression tests using ./run-tests.sh IPv4: Regression tests using ./run-tests.sh for release-3.7 branch verified by comparing with clean repo. IPv6: (Need to add the above mentioned config and also add an entry for "hostname ::1" in /etc/hosts) Started failing at ./tests/basic/glusterd/arbiter-volume-probe.t and ran successfully till here Change-Id: Idd7513aa2347ce0de2b1f68daeecce1b7a39a7af BUG: 1310445 Signed-off-by: Nithin D <nithind1988@yahoo.in> Reviewed-on: http://review.gluster.org/13787 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* socket: Launch socket_poller only if connect succeededKaushal M2016-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Backport of 92abe07 from master For an encrypted connection, sockect_connect() used to launch socket_poller() in it's own thread (ON by default), even if the connect failed. This would cause two unrefs to be done on the transport, once in socket_poller() and once in socket_connect(), causing the transport to be freed and cleaned up. This would cause further reconnect attempts from failing as the transport wouldn't be available. By starting socket_poller() only if connect succeeded, this is avoided. BUG: 1314641 Change-Id: Ifd1bc4d48a8bdf741e32d02bdbac91530e0e8111 Signed-off-by: Kaushal M <kaushal@redhat.com> Originally-reviewed-on: http://review.gluster.org/13554 Reviewed-on: http://review.gluster.org/13604 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
* socket: reduce rate of readv failure logs due to disconnectKrishnan Parthasarathi2016-02-232-5/+7
| | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/8210 ... by using GF_LOG_OCCASIONALLY Change-Id: I779ff32ead13c8bb446a57b5baccf068ae992df1 BUG: 1310969 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8210 Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/13487
* rdma:restore device linked list structure in case of failureMohammed Rafi KC2016-02-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We maintain a linked list strcture to store device information, and maintain head in a ctx variable. A new device will be added at the beginning of list. But if the device creation failed, then we need to adjust the linked list to proper state. back port of : >Change-Id: I07cefd3b808d8973a915728b3ba7f2955d29c92a >BUG: 1250297 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/11829 >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Raghavendra G <rgowdapp@redhat.com> (cherry picked from commit 7641eb8b469a6dd4db6db59d2a5ef4d5a65e1a61) Change-Id: I5e7bcdef9402c11a139db8047ae2a9a18cdd8f4e BUG: 1254430 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11943 CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* all: reduce "inline" usageKaleb S KEITHLEY2016-01-182-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | There are three kinds of inline functions: plain inline, extern inline, and static inline. All three have been removed from .c files, except those in "contrib" which aren't our problem. Inlines in .h files, which are overwhelmingly "static inline" already, have generally been left alone. Over time we should be able to "lower" these into .c files, but that has to be done in a case-by-case fashion requiring more manual effort. This part was easy to do automatically without (as far as I can tell) any ill effect. In the process, several pieces of dead code were flagged by the compiler, and were removed. backport of Change-Id: I56a5e614735c9e0a6ee420dab949eac22e25c155, http://review.gluster.org/11769, BUG: 1245331 Change-Id: Iba1efb0bc578ea4a5e9bf76b7bd93dc1be9eba44 BUG: 1283302 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/12646 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* build: fix ecdh.h and dh.h depsMilind Changire2015-11-202-8/+12
| | | | | | | | | | | | | | | | | | | | | | openssl/ecdh.h and openssl/dh.h are not available on all platforms, especially rhel-5. This patch adds check to autoconf and updates relevant source files. Added conditional to test for SSL_OP_NO_TICKET and SSL_OP_NO_COMPRESSION presence before setting the SSL context options. Macros UTIME_OMIT and UTIME_NOW picked up from Fedora 22 /usr/include/bits/stat.h to help rhel-5 build. Change-Id: I2bdee4fe643f9c1f5fe77cf89bd30946cd6b591a Reviewed-on: http://review.gluster.org/#/c/12517/ BUG: 1258594 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: http://review.gluster.org/12518 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* SSL improvements: do not fail if certificate purpose is setEmmanuel Dreyfus2015-08-232-0/+9
| | | | | | | | | | | | | | | | | | Since glusterfs shares the same settings for client-side and server-side of SSL, we need to ignore any certificate usage specification (SSL client vs SSL server), otherwise SSL connexions will fail with 'unsupported cerritifcate" Backport of I7ef60271718d2d894176515aa530ff106127bceb BUG: 1247153 Change-Id: I04e2f50dafd84d6eee15010f045016c91a0e1aac Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/11842 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* rdma : porting missing gf_log to gf_msgManikandan Selvaganesh2015-08-122-11/+15
| | | | | | | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/#/c/11607/ Cherry picked from commit 6beb9ca292a0653d3d082af9d30f519a99569a14 > Change-Id: I036b43007fbcd0e528faab8d44e1a7fc820eaf1f > BUG: 1242333 > Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> > Reviewed-on: http://review.gluster.org/11607 > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Tested-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I036b43007fbcd0e528faab8d44e1a7fc820eaf1f BUG: 1252272 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/11878 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* SSL improvements: ECDH, DH, CRL, and accessible optionsEmmanuel Dreyfus2015-08-052-80/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce ssl.dh-param option to specify a file containinf DH parameters. If it is provided, EDH ciphers are available. - Introduce ssl.ec-curve option to specify an elliptic curve name. If unspecified, ECDH ciphers are available using the prime256v1 curve. - Introduce ssl.crl-path option to specify the directory where the CRL hash file can be found. Setting to NULL disable CRL checking, just like the default. - Make all ssl.* options accessible through gluster volume set. - In default cipher list, exclude weak ciphers instead of listing the strong ones. - Enforce server cipher preference. - introduce RPC_SET_OPT macro to factor repetitive code in glusterd-volgen.c - Add ssl-ciphers.t test to check all the features touched by this change. Backport of I7bfd433df6bbf176f4a58e770e06bcdbe22a101a Change-Id: I2947eabe76ae0487ecad52a60befb7de473fc90c BUG: 1247153 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>@ Reviewed-on: http://review.gluster.org/11763 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* rpc: fix binding brick issue while bind-insecure is enabledPrasanna Kumar Kalever2015-07-262-50/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is backport of http://review.gluster.org/#/c/11512/ > problem: > When bind-insecure is turned on (which is the default now), it may happen > that brick is not able to bind to port assigned by Glusterd for example > 49192-49195... > > It seems to occur because the rpc_clnt connections are binding to ports in > the same range. so brick fails to bind to a port which is already used by > someone else > > solution: > > fix for now is to make rpc_clnt to get port numbers from 65535 in a > descending > order, as a result port clash is minimized > > other fixes: > > previously rdma binds to port >= 1024 if it cannot find a free port < 1024, > even when bind insecure was turned off(ref to commit '0e3fd04e'), this patch > add's a check for bind-insecure in gf_rdma_client_bind function > > This patch also re-enable bind-insecure and allow insecure by default > which was reverted (ref: commit cef1720) previously > Change-Id: Ia1cfa93c5454e2ae0ff57813689b75de282ebd07 > BUG: 1238661 > Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Change-Id: Iea55f9b2a57b5e24d3df2c5fafae12fe99e9dee0 BUG: 1246481 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/11758 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* rpc,server,glusterd: Init transport list for accepted transportKaushal M2015-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GlusterD or a brick would crash when encrypted transport was enabled and an unencrypted client tried to connect to them. The crash occured when GlusterD/server tried to remove the transport from their xprt_list due to a DISCONNECT event. But as the client transport's list head wasn't inited, the process would crash when list_del was performed. Initing the client transports list head during acceptence, prevents this crash. Also, an extra check has been added to the GlusterD and Server notification handlers for client DISCONNECT events. The handlers will now first check if the client transport is a member of any list. GlusterD and Server DISCONNECT event handlers could be called without the ACCEPT handler, which adds the transport to the list, being called. This situation also occurs when an unencrypted client tries to establish a connection with an encrypted server. Change-Id: Icc24a08d60e978aaa1d3322e0cbed680dcbda2b4 BUG: 1246809 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/11692 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> (cherry picked from commit a909ccfa1b4cbf656c4608ef2124347851c492cb) Reviewed-on: http://review.gluster.org/11762
* rpc-transport: socket_poller fixes for proper working of mgmt encryptionKaushal M2015-07-141-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport of 8c39f14 from master socket_poller, the polling function used by ssl own_thread, had two issues which lead to GlusterD crashes when using management encryption Issue 1 ------- socket_poller calls functions which require THIS to be set. But, THIS was being set conditionally. Because of this, functions could sometimes be called without THIS being set. For example, rpc_transport_notify could be called for an accepted client socket without THIS being set, as THIS was only set it the transport wasn't yet connected. This would cause the process to crash when THIS was accessed by the called functions. To fix this, THIS is being set at the start of socket_poller unconditionally. Issue 2 ------- DISCONNECT notify was being sent on the listener transport instead of the client transport. The DISCONNECT event was converted to a LISTENER_DEAD event in rpcsvc_handle_disconnect, as it could not find the listener socket of the listener socket. GlusterD was notified of a LISTENER_DEAD event instead of a DISCONNECT and failed to remove the client transport from its xprt_list. The transport would subsequently be freed, leaving the xprt_list with a corrupted/invalid entry. Later, when GlusterD would iterate over the xprt_list to send notifications, it would crash when the invalid entry was accessed. To fix this, DISCONNECT notification in socket_poller is sent on the client socket, as it is done in the epoll handler. Change-Id: I0370b7c6d7eb13de10ebf08d91a4a39dc7d64c7a BUG: 1242734 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/11655 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
* Revert "rpc: By default set allow-insecure, bind-insecure to on"Raghavendra G2015-07-021-34/+17
| | | | | | | | | | | | | This reverts commit 243a5b429f225acb8e7132264fe0a0835ff013d5. This patch introduced a regression where client no longer binds to privileged port. This is causing lots of regressions. Hence reverting this patch for now and will be resent after suitable modifications. Change-Id: I302252fd3832b0a5a03b04e30cfa0def37597404 Reviewed-on: http://review.gluster.org/11508 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rpc: By default set allow-insecure, bind-insecure to onPrasanna Kumar Kalever2015-06-301-17/+34
| | | | | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/11039 since we now use SSL (Secure Sockets Layer) for the security issues, the patch changes the default setting to allow connections/requests from non-privilaged ports by setting allow-insecure and bind-insecure to 1 Also added bind functionality for insecure binding which can select from available local ports dynamically BUG: 1232660 Change-Id: I927e112223f33611452093e38cd846a0b9347e57 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/11274 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* rdma : removing duplicate printing of error string in gf_msgManikandan Selvaganesh2015-06-282-35/+27
| | | | | | | | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/#/c/11426/ Cherry picked from commit 7a3736b4a46dd07d65e27d892a85299a37fdd9a2 > Change-Id: I206cf80392d430f35558cc11699402c4cef12527 > BUG: 1194640 > Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> > Reviewed-on: http://review.gluster.org/11426 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Tested-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I206cf80392d430f35558cc11699402c4cef12527 BUG: 1217722 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/11448 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anuradha Talur <atalur@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: porting rdma to new message id logging formatHumble Devassy Chirammal2015-06-254-371/+695
| | | | | | | | | | | | | | | | | | | | | | Backport of http://review.gluster.org/#/c/9868/ Cherry picked from 4306245aef7cdcbfa6d7a59dccd031d4ada54105 > Change-Id: I71e940817ae0a9378e82332d5a8569114fc13482 > BUG: 1194640 > Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> > Reviewed-on: http://review.gluster.org/9868 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Tested-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I71e940817ae0a9378e82332d5a8569114fc13482 BUG: 1217722 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/10673 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* build: fix compiling on older distributionsNiels de Vos2015-06-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data-tiering is disabled on RHEL-5 because it depends on a too new SQLite version. This change also prevents installing some of files that are used by geo-replication, which is also not available on RHEL-5. geo-replication depends on a too recent version of Python. Due to an older version of OpenSSL, some of the newer functions can not be used. A fallback to previous functions is done. Unfortunately RHEL-5 does not seem to have TLSv1.2 support, so only older versions can be used. Cherry picked from commit 0209b18fd65f9df5ebd0a8764ebf864d0d392998: > Change-Id: I672264a673f5432358d2e83b17e2a34efd9fd913 > BUG: 1222317 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/10803 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> Also including the changes from http://review.gluster.org/11140: > build: improve detection of new OpenSSL features > > Building on Mac OS X revealed that the current check for > CRYPTO_THREADID_set_callback() availability in OpenSSL is not correct. > > There also does not seem to be a guarantee that TLSv1_2_method() is > available when TLS1_2_VERSION is #define'd. > > Change-Id: I21508065fc181a1c74bee4fd6d23bb5bdf7cea7a > BUG: 1222317 > Reviewed-on: http://review.gluster.org/11140 > Original-author: Kaleb KEITHLEY <kkeithle@redhat.com> > Signed-off-by: Niels de Vos <ndevos@redhat.com> Change-Id: I672264a673f5432358d2e83b17e2a34efd9fd913 BUG: 1228510 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11096 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* socket: throttle only connected transportKrishnan Parthasarathi2015-06-041-2/+15
| | | | | | | | | | | | BUG: 1227167 Change-Id: I2352c6661ae5aee8cf06e572ec0462b76901d46f Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10887 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/11038 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma:properly handle iobuf_pool when rdma transport is unloadedMohammed Rafi KC2015-05-072-20/+62
| | | | | | | | | | | | | | | | | | | | | Back port of : http://review.gluster.org/9854 We are registering iobuf_pool with rdma. When rdma transport is unloaded, we need to deregister all the buffers registered with rdma. Otherwise iobuf_arena destroy will fail. Also if rdma.so is loaded again, then register iobuf_pool with rdma Change-Id: Ic197721a44ba11dce41e03058e0a73901248c541 BUG: 1218653 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9854 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/10585 Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* socket: use OpenSSL multi-threading interfacesJeff Darcy2015-04-092-3/+70
| | | | | | | | | | | | | | | | | | | | | | | | OpenSSL isn't thread-safe unless you register these locking and thread ID functions. Most often the crashes would occur around X509_verify_cert, even though it's insane that the certificate parsing functions wouldn't be thread-safe. The bug for this was filed over two years ago, but it didn't seem like a high priority because the bug didn't bite anyone until it caused a spurious regression-test failure. Ironically, that was on a test for a *different* spurious regression-test failure, which I guess is just deserts[1] for leaving this on the to-do list so long. [1] Yes, it really is "deserts" in that phrase - not as in very dry places, but from late Latin "deservire" meaning to serve well or zealously. Aren't commit messages educational? Change-Id: I2a6c0e9b361abf54efa10ffbbbe071404f82b0d9 BUG: 906763 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/10075 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* socket: use TLS 1.2 instead of 1.0Jeff Darcy2015-03-271-1/+1
| | | | | | | | | Change-Id: I96e9b37e4855f5e12b2dbecf1f0b0887b21ad5ad Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/9949 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* socket: use TCP_USER_TIMEOUT to detect client failures quickerNiels de Vos2015-03-172-7/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the network.ping-timeout to set the TCP_USER_TIMEOUT socket option (see 'man 7 tcp'). The option sets the transport.tcp-user-timeout option that is handled in the rpc/socket layer on the protocol/server side. This socket option makes detecting unclean disconnected clients more reliable. When the socket gets closed, any locks that the client held are been released. This makes it possible to reduce the fail-over time for applications that run on systems that became unreachable due to a network partition or general system error client-side (kernel panic, hang, ...). It is not trivial to create a test-case for this at the moment. We need a client that unclean disconnects and an other client that tries to take over the lock from the disconnected client. URL: http://supercolony.gluster.org/pipermail/gluster-devel/2014-May/040755.html Change-Id: I5e5f540a49abfb5f398291f1818583a63a5f4bb4 BUG: 1129787 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8065 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Santosh Pradhan <santosh.pradhan@gmail.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* rdma:changing list iteration to safe modeMohammed Rafi KC2015-03-151-5/+10
| | | | | | | | | | | Change-Id: I2299378f02a5577a8bf2874664ba79e92c3811b5 BUG: 1201621 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9872 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* rdma: Free resources related to iobuf in finiMohammed Rafi KC2015-03-102-0/+19
| | | | | | | | | | | | | | | | If rdma transport is destroyed because of any reason, then rdma.so will be unloaded. But we are not setting iobuf registeration function to null. After this, if an iobuf request is came, then we will try to call a function which is not loaded. Change-Id: I3293f9974e16d8e865131785ee697ea02be8cdfc BUG: 1187456 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9697 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* rdma:enhance logging when a connection error occurMohammed Rafi KC2015-03-101-1/+3
| | | | | | | | | | | Change-Id: I6146307949a3d852d3af5f8b273004ad6b27451b BUG: 1196584 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9756 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* rdma: return proper data type.Humble Devassy Chirammal2015-03-091-1/+1
| | | | | | | | | | Change-Id: I9bb0898af96cfcfaba0f0c976a7808bc6ea08e6a Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/9838 Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: 'list','wr' and 'new' memory has to be verified.Humble Devassy Chirammal2015-03-091-1/+22
| | | | | | | | | | | Change-Id: I29a8825107b8f4cefe4f4c59296e98fe675ee943 BUG: 1199053 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/9811 Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma:setting wrong remote memory.Mohammed Rafi KC2015-03-041-2/+2
| | | | | | | | | | | | | when we send more than one work request in a single call, the remote addr is always setting as the first address of the vector. Change-Id: I55aea7bd6542abe22916719a139f7c8f73334d26 BUG: 1197548 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9794 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: segfault trying to call ibv_dealloc_pd on a null pointer Mark Lipscombe2015-03-031-1/+3
| | | | | | | | | | | | | | if ibv_alloc_pd failed If creating an ib protection domain fails, during the cleanup a segfault will occur because trav->pd is null. Bug: 1197260 Change-Id: I21b867c204c4049496b1bf11ec47e4139610266a Signed-off-by: Mark Lipscombe <mlipscombe@gmail.com> Reviewed-on: http://review.gluster.org/9774 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* epoll: Fix broken RPC throttling due to MT epollShyam2015-03-011-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The RPC throttle which kicks in by setting the poll-in event on a socket to false, is broken with the MT epoll commit. This is due to the event handler of poll-in attempting to read as much out of the socket till it receives an EAGAIN. Which may never happen and hence we would be processing far more RPCs that we want to. This is being fixed by changing the epoll from ET to LT, and reading request by request, so that we honor the throttle. The downside is that we do not drain the socket, but go back to epoll_wait before reading the next request, but when kicking in throttle, we need to anyway and so a busy connection would degrade to LT anyway to maintain the throttle. As a result this change should not cause deviation in the performance much for busy connections. Change-Id: I522d284d2d0f40e1812ab4c1a453c8aec666464c BUG: 1192114 Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/9726 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* socket: allow only one epoll thread to read msg fragmentsKrishnan Parthasarathi2015-02-272-0/+13
| | | | | | | | | | | | | | | | | __socket_read_reply function releases sock priv->lock briefly for notifying higher layers of message's xid. This could result in other epoll threads that are processing events on this socket to read further fragments of the same message. This may lead to incorrect fragment processing and result in a crash. Change-Id: I915665b2e54ca16f2ad65970e51bf76c65d954a4 BUG: 1197118 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/9742 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: Fix failure to call rdma_bind_addr if unable to bind privileged port.Mark Lipscombe2015-02-261-1/+8
| | | | | | | | | | | | | | | When unable to bind a privileged port, rdma_bind_addr is not called. This patch fixes that. Change-Id: I175884a5d6a08b93dc62653ee0a6622bfc06e618 Bug: 1195907 Signed-off-by: Mark Lipscombe <mlipscombe@gmail.com> Reviewed-on: http://review.gluster.org/9737 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: free rdma priv data if init failsAtin Mukherjee2015-02-191-0/+2
| | | | | | | | | | | Change-Id: I57b38c8783666e806836dacf3f74cf9f6876070a BUG: 1164079 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9687 Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: pre-register iobuf_pool with rdma devices.Mohammed Rafi KC2015-02-172-14/+196
| | | | | | | | | | | | | | | | | | registring buffers with rdma device is a time consuming operation. So performing registration in code path will decrease the performance. Using a pre registered memory will give a bettor performance, ie, register iobuf_pool during rdma initialization. For dynamically created arena, we can register with all the device. Change-Id: Ic79183e2efd014c43faf5911fdb6d5cfbcee64ca BUG: 1187456 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9506 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: reduce log level from E to WMohammed Rafi KC2015-02-171-1/+1
| | | | | | | | | | | | | | glusterd process, when try to initialize default vol file, will always through an error if there is no rdma device. Changing the log levels and log messages to more appropriately. Change-Id: I75b919581c6738446dd2d5bddb7b7658a91efcf4 BUG: 1188232 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9559 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>