Bug 1271325 - RFE: use code generation for repetitive stuff
RFE: use code generation for repetitive stuff
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: core (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeff Darcy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-13 12:09 EDT by Jeff Darcy
Modified: 2016-06-16 09:39 EDT (History)
2 users (show)

See Also:
Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-16 09:39:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Darcy 2015-10-13 12:09:26 EDT
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 12:10:52 EDT
REVIEW: http://review.gluster.org/9411 (libglusterfs: replace default functions with generated versions) posted (#10) for review on master by Jeff Darcy (jdarcy@redhat.com)
Comment 2 Vijay Bellur 2015-10-19 12:14:14 EDT
REVIEW: http://review.gluster.org/9411 (libglusterfs: replace default functions with generated versions) posted (#11) for review on master by Jeff Darcy (jdarcy@redhat.com)
Comment 3 Vijay Bellur 2015-10-23 01:51:49 EDT
COMMIT: http://review.gluster.org/9411 committed in master by Vijay Bellur (vbellur@redhat.com) 
------
commit fb2a511493868a9ff0c2926537a4d1d23821ce38
Author: Jeff Darcy <jdarcy@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/9411
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Comment 4 Vijay Bellur 2015-11-18 00:02:31 EST
REVIEW: http://review.gluster.org/12603 (build: add libglusterfs/src/defaults.c to .gitignore) posted (#1) for review on master by Ravishankar N (ravishankar@redhat.com)
Comment 5 Vijay Bellur 2015-11-18 08:11:47 EST
COMMIT: http://review.gluster.org/12603 committed in master by Jeff Darcy (jdarcy@redhat.com) 
------
commit 92919e7de3d9ceaa70d4103266fc438dd28441cc
Author: Ravishankar N <ravishankar@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/12603
    Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Comment 6 Mike McCune 2016-03-28 18:45:31 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 7 Niels de Vos 2016-06-16 09:39:57 EDT
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

Note You need to log in before you can comment on or make changes to this bug.