Skip to content
  • Chris Elder's avatar
    [FAB-2960] Transaction Mgr changes batch optimizations · 7d90d014
    Chris Elder authored
    
    
    This is change is part of FAB-2725 CouchDB optimizations
    
    Interactions with CouchDB are currently done individually.
    Need to switch to using bulk operations to get optimal performance
    from CouchDB. Need to performance test and stress test.
    
    This change implements all changes needed by the commit phase to use
    bulk operations in CouchDB.
    
    A subsequent change will implement validation bulk read and caching
    of versions and revisions for CouchDB.
    
    Subsequent changes will also be added to retry errors encountered by
    the bulk update operation and a configuration setting to limit the
    size of the bulk update by number of update documents.
    
    - Add new interface to statedb for bulk operations, the new operations
    will only be implemented for databases that can support bulk operations
    (only CouchDB)
    
    type BulkOptimizable interface {
    	LoadCommittedVersions(keys []*CompositeKey)
    	ClearCachedVersions()
    }
    
    LoadCommittedVersions will bulk load version and revision numbers into
    cache based on the document ID.  Documents missing a version or revision
    will be added to the cache with a nil value.
    
    - Add GetVersion method to VersionedDB to enhance batch
    validation of batches
    
    GetVersion(namespace string, key string) (*version.Height, error)
    
    - Implement the GetVersion method for CouchDB and goleveldb.  The goleveldb
    implementation will be similar to GetState, except it will return the
    version.  CouchDB implementation will attempt a cache lookup, then fall
    back to a database read if not found.
    
    - Enhance the ApplyUpdates method for CouchDB to incorporate the
    ability to retrieve all revision information required for bulk
    updates and deletes for CouchDB.
    
    Change-Id: I65f8525a7a13b1ad7b49fda0e357b9a406fba79d
    Signed-off-by: default avatarChris Elder <chris.elder@us.ibm.com>
    7d90d014