path: root/gluster/swift/obj/
diff options
authorPrashanth Pai <>2016-03-10 15:30:36 +0530
committerThiago da Silva <>2016-04-04 11:01:36 -0700
commit789f1a150c87f05905b02dfdd8ad77ac6c1ba46f (patch)
tree7589e03ff9d02f3bff90320447582ce4a10d64a3 /gluster/swift/obj/
parentc73037e90c3f551caf18df41efd7fa9750454a10 (diff)
Remove redundant syscalls in POST path
During process of POST requests which updates object metadata (xattrs), the following (ordered) sequence of syscalls were being made twice: open(), fstat(), fgetxattr(), close() Intuitively, one may assume that a getxattr() and setxattr() is enough to fulfil the POST request as it is only supposed to update metadata. But this isn't the case. The above series of syscalls is made first during This will trigger an update of all stale metadata (outdated size/etag) and the result is retained in a diskfile class attribute named 'self._metadata' Instead of using this pre-fetched metadata, the POST path was internally invoking again in disk_file.write_metadata(). This is redundant and serves no purpose. self._metadata was being erased during the context manager cleanup of This change is simple and does the following: * Don't erase fetched metadata during context manager exit of open() * Use a different internal variable to detect and raise DiskFileNotOpen * Re-use self._metadata if available in disk_file.write_metadata() Here's comparing syscalls made (POST path) with and without this fix: Change-Id: Ib64c103e5904428df20ec6e8f10140f4f68e7f79 Signed-off-by: Prashanth Pai <> Reviewed-on: Reviewed-by: Thiago da Silva <> Tested-by: Thiago da Silva <>
Diffstat (limited to 'gluster/swift/obj/')
0 files changed, 0 insertions, 0 deletions