Bug 868086

Summary: Fetching the object metadata involves multiple stat() system calls when one suffices
Product: [Community] Gluster-Swift Reporter: Peter Portante <pportant>
Component: object-serverAssignee: Nobody <nobody>
Status: MODIFIED --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 0.1CC: bugs, perfbz, pportant
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 903396, 978061    

Description Peter Portante 2012-10-19 04:01:57 UTC
Description of problem:

  Generating, or regenerating, metadata for an object (not a container or
  account) involves multiple stat system calls when one will suffice.

Version-Release number of selected component (if applicable):

  RHS 2.0

How reproducible:

  Every time.

Steps to Reproduce:
1. strace object-server process
2. PUT a new object
3. GET that object
4. Observe stat system calls made in strace output

Actual results:

  Multiple stat system calls made.

Expected results:

  One system call made on behalf of the GET operation.

Additional info:

  See http://pastebin.test.redhat.com/110818 from lines 226 through 243,
  you'll notice the following stat() and fstat() calls made to the file
  being fetched ("testfile.txt"):
    * Line 226, stat()
    * Line 235, stat()
    * Line 237, fstat() of same file open'd on fd 15
    * Line 238, stat()
    * Line 243, fstat() of same file open'd on fd 15

  These 5 calls can most likely be reduced to at most one.

Comment 1 Peter Portante 2012-10-19 04:02:56 UTC
I am currently working on a set of refactorings that should address this issue.

Comment 2 Vijay Bellur 2012-10-25 22:04:51 UTC
CHANGE: http://review.gluster.org/4112 (Reduce the number of stat/fstat system calls made) merged in master by Anand Avati (avati)