Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CouchDB indexes on implicit org collections #4777

Closed
bkiran6398 opened this issue Apr 1, 2024 · 1 comment
Closed

Support CouchDB indexes on implicit org collections #4777

bkiran6398 opened this issue Apr 1, 2024 · 1 comment

Comments

@bkiran6398
Copy link
Contributor

Current Status

CouchDB indexes are NOT supported on implicit organisation collections.

Expected

Support CouchDB indexes on implicit organisation collections (implicit_org) for faster query and data retrieval.

Solution

CouchDB indexes for _implicit_org_<MSPID> collections, which are not present in collectionConfigMap are skipped during handle chaincode deployment in peer.

I believe this check was added to avoid creation of database and index entries for collections which are not explicitly defined in collection-config but have an entry in chaincode indexes directory structure.
However indexing support for implicit collections can be easily provided by adding one more check like:

import "git.npci.org.in/vajra/hyperledger-fabric-sharding/core/chaincode/implicitcollection"

_, ok := collectionConfigMap[indexInfo.collectionName]
if !ok {
	isImplicitCollection, mspId := implicitcollection.MspIDIfImplicitCollection(indexInfo.collectionName)
	// skip if the collection is not an implicit collection or collection mspId is different from peer mspId
	if !isImplicitCollection || mspId != s.localMspId {
		logger.Errorf("Error processing index for chaincode [%s]: cannot create an index for an undefined collection=[%s]",
			chaincodeDefinition.Name, indexInfo.collectionName)
		continue
	}
}

Please let me know if there was any other reason for not supporting indexes on implicit organisation collections.
(I could not find any reasons in previous discussions and original Jira issue is inaccessible).

Please let us know if you plan to work on this.

Yes!

@bkiran6398
Copy link
Contributor Author

Closing issue as duplicate of #4780

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant