Hide Forgot
+++ This bug was initially created as a clone of Bug #1351620 +++ Description of problem: When client sends DELETE request for an object which does not exist, gluster-swift internally calls unlink() despite determining earlier that the file does not exist. Version-Release number of selected component (if applicable): RHGS 3.1.3 swiftonfile-2.3.0-3.el7rhgs How reproducible: Send a DELETE request on a non-existent object. Steps to Reproduce: 1. Create a container 2. Send DELETE for a non-existing object curl -i http://localhost:8080/v1/AUTH_test/c1/blah_blah -X DELETE HTTP/1.1 404 Not Found Content-Length: 70 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txb18a11352229424c9a7eb-005775136a Date: Thu, 30 Jun 2016 12:41:14 GMT <html><h1>Not Found</h1><p>The resource could not be found.</p></html> Before sending DELETE, attach strace to object-server process and monitor syscalls. root# ps aux | grep object-server root 1398 0.7 1.2 266960 26268 ? Ss 18:10 0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf root 1427 0.0 1.1 1413920 22756 ? Sl 18:10 0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf root 1510 0.0 0.1 112672 2100 pts/1 S+ 18:10 0:00 grep --color=auto object-server root# strace -ff -p 1398,1427 Process 1398 attached Process 1427 attached with 21 threads [pid 1427] getxattr("/mnt/gluster-object/test/c1/f1", "user.swift.metadata", 0x0, 0) = -1 ENOENT (No such file or directory) [pid 1427] getxattr("/mnt/gluster-object/test/c1/f1", "user.swift.metadata", 0x0, 0) = -1 ENOENT (No such file or directory) [pid 1427] unlink("/mnt/gluster-object/test/c1/f1") = -1 ENOENT (No such file or directory) Actual results: unlink() is called on the non-existent path. Expected results: unlink() should not be called non-existent path. --- Additional comment from Red Hat Bugzilla Rules Engine on 2016-06-30 08:45:21 EDT --- This bug is automatically being proposed for the current z-stream release of Red Hat Gluster Storage 3 by setting the release flag 'rhgs‑3.1.z' to '?'. If this bug should be proposed for a different release, please manually change the proposed release flag. --- Additional comment from Prashanth Pai on 2016-07-28 09:27:54 EDT --- Upstream patch: http://review.gluster.org/#/c/14501/ --- Additional comment from Red Hat Bugzilla Rules Engine on 2016-08-09 07:35:27 EDT --- Since this bug has been approved for the RHGS 3.2.0 release of Red Hat Gluster Storage 3, through release flag 'rhgs-3.2.0+', and through the Internal Whiteboard entry of '3.2.0', the Target Release is being automatically set to 'RHGS 3.2.0' --- Additional comment from Prashanth Pai on 2016-09-13 03:43:28 EDT --- Upstream change has been merged. --- Additional comment from Prashanth Pai on 2016-09-19 06:56:12 EDT --- Downstream changes have been submitted and merged. rhel7 - https://code.engineering.redhat.com/gerrit/#/c/85036/ rhel6 - https://code.engineering.redhat.com/gerrit/#/c/85055/ --- Additional comment from errata-xmlrpc on 2016-09-19 11:50:38 EDT --- Bug report changed to ON_QA status by Errata System. A QE request has been submitted for advisory RHEA-2016:24869-01 https://errata.devel.redhat.com/advisory/24869
Downstream changes have been submitted and merged. rhel6 - https://code.engineering.redhat.com/gerrit/#/c/85055/
curl -i http://localhost:8080/v1/AUTH_test/c1/fake -X DELETE HTTP/1.1 404 Not Found Content-Length: 70 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx6b6e29dff17247f697a4e-00585279a3 Date: Thu, 15 Dec 2016 11:08:19 GMT <html><h1>Not Found</h1><p>The resource could not be found.</p></html>[root@dhcp35-235 swift]# strace -ff -p 8542,8568 [pid 8568] poll([{fd=8, events=POLLIN|POLLPRI|POLLERR|POLLHUP}, {fd=12, events=POLLIN|POLLPRI|POLLERR|POLLHUP}, {fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 3, 60000) = 1 ([{fd=8, revents=POLLIN}]) [pid 8568] recvfrom(8, "DELETE /test/0/AUTH_test/c1/fake"..., 65536, 0, NULL, NULL) = 382 [pid 8568] getsockname(8, {sa_family=AF_INET, sin_port=htons(6010), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0 [pid 8568] gettimeofday({1481800066, 714857}, NULL) = 0 [pid 8568] gettimeofday({1481800066, 714914}, NULL) = 0 [pid 8568] gettimeofday({1481800066, 715134}, NULL) = 0 [pid 8568] lstat("/mnt/gluster-object/test", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 [pid 8568] lstat("/mnt/gluster-object/test/..", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 [pid 8568] getxattr("/mnt/gluster-object/test/c1/fake", "user.swift.metadata", 0x0, 0) = -1 ENOENT (No such file or directory) [pid 8568] gettimeofday({1481800066, 722018}, NULL) = 0 [pid 8568] gettimeofday({1481800066, 722131}, NULL) = 0 [pid 8568] sendto(8, "HTTP/1.1 404 Not Found\r\nContent-"..., 212, 0, NULL, 0) = 212 [pid 8568] gettimeofday({1481800066, 722345}, NULL) = 0 [pid 8568] gettimeofday({1481800066, 722397}, NULL) = 0 [pid 8568] shutdown(8, SHUT_RDWR) = 0 [pid 8568] close(8) = 0 [pid 8568] gettimeofday({1481800066, 722694}, NULL) = 0 [pid 8568] poll([{fd=12, events=POLLIN|POLLPRI|POLLERR|POLLHUP}, {fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 2, 60000 Verified that unlink call is not made on non-existent objects. marking it verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2017-0489.html