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 write batch #137

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

add write batch #137

wants to merge 1 commit into from

Conversation

pfi79
Copy link
Contributor

@pfi79 pfi79 commented Jan 8, 2025

Signed-off-by: Fedor Partanskiy <[email protected]>
@pfi79 pfi79 requested a review from a team as a code owner January 8, 2025 17:41
@pfi79
Copy link
Contributor Author

pfi79 commented Jan 8, 2025

@C0rWin
Copy link

C0rWin commented Jan 8, 2025

While reading the PR, I thought we might miss an API that can abort or cancel the collecting batch. For instance, there might be logic where the user reads something from the state and decides not to send anything or perform a different batch of operations.

Wdyt @pfi79? @denyeart, if you think it might make sense, do we need to update the RFC to reflect it, or can we implement a suggested API, say, CancelWriteBatch()?

@pfi79
Copy link
Contributor Author

pfi79 commented Jan 9, 2025

While reading the PR, I thought we might miss an API that can abort or cancel the collecting batch. For instance, there might be logic where the user reads something from the state and decides not to send anything or perform a different batch of operations.

Wdyt @pfi79? @denyeart, if you think it might make sense, do we need to update the RFC to reflect it, or can we implement a suggested API, say, CancelWriteBatch()?

Let's talk about it. I wrote this change so that I don't have to change the chaincode for different peers. That is, those that support WriteBatch and those that do not (flag usePeerWriteBatch true or false). And I think that behaviour should not change, maximum in processing speed.

What will happen to your proposal if the old peer is next to the new chaincode?

In my variant, the call to StartWriteBatch will not fail, but it will be ignored and the sending of changes will follow the old one. What should CancelWriteBatch() do in this case?

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.

2 participants