Skip to content

Commit

Permalink
[FAB-10558] Fix bug for bulkupdates of write-only keys
Browse files Browse the repository at this point in the history
This CR fixes a small bug in the code path of writing the documents
to the couchdb using bulkload. The loaded revisions numbers were not
getting added to the revision map properly in the case of write-only
keys.

Change-Id: I7977b75a87d13156dd889f20b2e81e75a8c5b7d4
Signed-off-by: manish <manish.sethi@gmail.com>
  • Loading branch information
manish-sethi committed Jun 11, 2018
1 parent df69ad4 commit 37c65aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,13 @@ func addRevisionsForMissingKeys(revisions map[string]string, db *couchdb.CouchDa
missingKeys = append(missingKeys, key)
}
}
logger.Debugf("Pulling revisions for the [%d] keys for namsespace [%s] that were not part of the readset", len(missingKeys), db.DBName)
retrievedMetadata, err := retrieveNsMetadata(db, missingKeys)
if err != nil {
return err
}
for _, metadata := range retrievedMetadata {
revisions[metadata.ID] = revisions[metadata.Rev]
revisions[metadata.ID] = metadata.Rev
}
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
)

func TestMain(m *testing.M) {
flogging.SetModuleLevel("statecouchdb", "debug")
flogging.SetModuleLevel("couchdb", "debug")
os.Exit(testMain(m))
}

Expand Down

0 comments on commit 37c65aa

Please sign in to comment.