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

add support WriteBatch operations #5113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pfi79
Copy link
Contributor

@pfi79 pfi79 commented Jan 21, 2025

@pfi79 pfi79 requested a review from a team as a code owner January 21, 2025 19:52
@pfi79 pfi79 requested review from C0rWin and denyeart January 21, 2025 19:53
@pfi79
Copy link
Contributor Author

pfi79 commented Jan 21, 2025

In the e2e integration tests, benchmark test has been added and 2 speed tables appear with and without the use of batch.

image image

@pfi79 pfi79 force-pushed the batch-operation branch 2 times, most recently from 31c3dbf to 9776b45 Compare January 23, 2025 06:05
integration/e2e/bench_write_batch_test.go Outdated Show resolved Hide resolved
integration/chaincode/multi/chaincode.go Outdated Show resolved Hide resolved
integration/e2e/bench_write_batch_test.go Outdated Show resolved Hide resolved
sampleconfig/core.yaml Outdated Show resolved Hide resolved
@pfi79 pfi79 force-pushed the batch-operation branch 5 times, most recently from 4790b27 to cc24ab3 Compare January 25, 2025 05:55
@pfi79 pfi79 requested a review from denyeart January 25, 2025 06:24
Copy link
Contributor

@C0rWin C0rWin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, while I think we should take care to add tests to make sure behaviour remain consistent as @manish-sethi mentioned is his comment hyperledger/fabric-rfcs#58 (comment)

@pfi79
Copy link
Contributor Author

pfi79 commented Jan 28, 2025

Overall looks good to me, while I think we should take care to add tests to make sure behaviour remain consistent as @manish-sethi mentioned is his comment hyperledger/fabric-rfcs#58 (comment)

Thanks @C0rWin
I'm willing to finish any tests.
But I'm not quite sure what those tests should be.
If they give me scenarios, I'd be happy to implement them.

@C0rWin
Copy link
Contributor

C0rWin commented Feb 3, 2025

Overall looks good to me, while I think we should take care to add tests to make sure behaviour remain consistent as @manish-sethi mentioned is his comment hyperledger/fabric-rfcs#58 (comment)

Thanks @C0rWin I'm willing to finish any tests. But I'm not quite sure what those tests should be. If they give me scenarios, I'd be happy to implement them.

One of the possible scenarios related to the update of the private data is where there is a check whenever a collection with a given name exists, see

if err := s.queryExecutor.validateCollName(ns, coll); err != nil {
... The test should, for example, check what happens when you start batch where you are trying to write into the non-existing collection, without batch it's resulted with error, need to check this behavior is consistent.

Another example would be to check whenever chaincode does write into private data and then query private data it supposes to result in an error based on this check, see here:

func (s *txSimulator) checkBeforePvtdataQueries() error {

Signed-off-by: Fedor Partanskiy <[email protected]>
@pfi79
Copy link
Contributor Author

pfi79 commented Feb 5, 2025

Overall looks good to me, while I think we should take care to add tests to make sure behaviour remain consistent as @manish-sethi mentioned is his comment hyperledger/fabric-rfcs#58 (comment)

Thanks @C0rWin I'm willing to finish any tests. But I'm not quite sure what those tests should be. If they give me scenarios, I'd be happy to implement them.

One of the possible scenarios related to the update of the private data is where there is a check whenever a collection with a given name exists, see

if err := s.queryExecutor.validateCollName(ns, coll); err != nil {

... The test should, for example, check what happens when you start batch where you are trying to write into the non-existing collection, without batch it's resulted with error, need to check this behavior is consistent.
Another example would be to check whenever chaincode does write into private data and then query private data it supposes to result in an error based on this check, see here:

func (s *txSimulator) checkBeforePvtdataQueries() error {

@C0rWin @denyeart
Added the right tests.
Please take a look at my proposal.

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

Successfully merging this pull request may close these issues.

3 participants