Bug 1271325

Summary: RFE: use code generation for repetitive stuff
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: coreAssignee: Jeff Darcy <jdarcy>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj, bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-16 13:39:57 UTC 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:

Description Jeff Darcy 2015-10-13 16:09:26 UTC
NSR relies heavily on this to avoid writing 6K lines of boilerplate where 300 lines of templates will do, and will never get done on schedule otherwise.  Several existing parts of our core code can also benefit, reducing duplication and thus potential for error when some but not all of the copies are updated (as has actually bitten us several times).  Leading candidates include default functions, stubs, and syncops.  There will probably be multiple patches representing successive improvements in this area, but it doesn't seem worth adding separate bugs unless those are proceeding in parallel.

Comment 1 Vijay Bellur 2015-10-13 16:10:52 UTC
REVIEW: http://review.gluster.org/9411 (libglusterfs: replace default functions with generated versions) posted (#10) for review on master by Jeff Darcy (jdarcy)

Comment 2 Vijay Bellur 2015-10-19 16:14:14 UTC
REVIEW: http://review.gluster.org/9411 (libglusterfs: replace default functions with generated versions) posted (#11) for review on master by Jeff Darcy (jdarcy)

Comment 3 Vijay Bellur 2015-10-23 05:51:49 UTC
COMMIT: http://review.gluster.org/9411 committed in master by Vijay Bellur (vbellur) 
------
commit fb2a511493868a9ff0c2926537a4d1d23821ce38
Author: Jeff Darcy <jdarcy>
Date:   Tue Oct 6 13:19:01 2015 -0400

    libglusterfs: replace default functions with generated versions
    
    Replacing repetitive code like this with code generated from a more
    compact "canonical" definition carries several advantages.
    
     * Ease the process of adding new fops (e.g. GF_FOP_IPC).
    
     * Ease the process of making global changes to existing fops (e.g.
       adding "xdata").
    
     * Ensure strict consistency between all of the pieces that must be
       compatible with each other, through both kinds of changes.
    
    What we have right now is just a start.  The above benefits will only
    truly be realized when we use the same definitions to generate stubs,
    syncops, and perhaps even parts of gfapi or glupy.
    
    This same infrastructure can also be used to reduce code duplication and
    potential for error in many of our translators.  NSR already uses a
    similar technique, using a few hundred lines of templates to generate a
    few *thousand* lines of code.  The ability to make a global "aspect"
    change (e.g. to quorum checking) in one place instead of seventy has
    already been demonstrated there.
    
    Other candidates for code generation include the AFR/EC transaction
    infrastructure, or stub creation/resumption in io-threads.
    
    Change-Id: If7d59de7a088848b557f5aea00741b4fe19017c1
    BUG: 1271325
    Signed-off-by: Jeff Darcy <jdarcy>
    Reviewed-on: http://review.gluster.org/9411
    Tested-by: Gluster Build System <jenkins.com>
    Tested-by: NetBSD Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 4 Vijay Bellur 2015-11-18 05:02:31 UTC
REVIEW: http://review.gluster.org/12603 (build: add libglusterfs/src/defaults.c to .gitignore) posted (#1) for review on master by Ravishankar N (ravishankar)

Comment 5 Vijay Bellur 2015-11-18 13:11:47 UTC
COMMIT: http://review.gluster.org/12603 committed in master by Jeff Darcy (jdarcy) 
------
commit 92919e7de3d9ceaa70d4103266fc438dd28441cc
Author: Ravishankar N <ravishankar>
Date:   Wed Nov 18 09:31:54 2015 +0530

    build: add libglusterfs/src/defaults.c to .gitignore
    
    defaults.c is auto-generated since commit
    fb2a511493868a9ff0c2926537a4d1d23821ce38. Hence adding it to .gitignore
    to stop git from complaining when switching branches.
    
    Change-Id: I586e20f3fe27124c0dc6ba7d151f957d3662a7d0
    BUG: 1271325
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: http://review.gluster.org/12603
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: NetBSD Build System <jenkins.org>

Comment 6 Mike McCune 2016-03-28 22:45:31 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 7 Niels de Vos 2016-06-16 13:39:57 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.

glusterfs-3.8.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user