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

CORE-8695 Add new backchain batch size config #1171

Merged
merged 15 commits into from
Aug 24, 2023

Conversation

nkovacsx
Copy link
Contributor

@nkovacsx nkovacsx commented Jul 6, 2023

Overview

We want to make sure that batch size in the backchain resolution flow is configurable. We'll use this config property to set the batch size.

@nkovacsx nkovacsx requested a review from lankydan July 6, 2023 12:15
@nkovacsx nkovacsx requested a review from a team as a code owner July 6, 2023 12:15
@nkovacsx nkovacsx requested a review from kyriathar July 6, 2023 12:16
@corda-jenkins-ci02
Copy link
Contributor

corda-jenkins-ci02 bot commented Jul 6, 2023

Jenkins build for PR 1171 build 15

Build Successful:
Jar artifact version produced by this PR: 5.1.0.15-alpha-1692803901138

nkovacsx and others added 3 commits July 6, 2023 14:32
…ration/ledger.utxo/1.0/corda.ledger.utxo.json

Co-authored-by: Lajos Veres <[email protected]>
…ration/ledger.utxo/1.0/corda.ledger.utxo.json

Co-authored-by: Lajos Veres <[email protected]>
@nkovacsx nkovacsx requested review from kyriathar and vlajos July 6, 2023 13:45
kyriathar
kyriathar previously approved these changes Jul 6, 2023
Copy link
Contributor

@kyriathar kyriathar left a comment

Choose a reason for hiding this comment

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

LGTM (introducing the initial config to the system wise)

Copy link
Contributor

@blsemo blsemo left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -135,6 +135,17 @@
<column name="update_actor" value="admin"/>
</insert>

<insert tableName="config">
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'd need a new liquibase file for this since this is coming after 5.0? Can someone else confirm this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point - if it goes into 5.1, it needs a new changeset, so ideally a new file so a liquibase upgrade would work.

Copy link
Contributor

@kyriathar kyriathar Jul 7, 2023

Choose a reason for hiding this comment

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

Good catch. @nkovacsx actually identified and pointed out the need for this to be added in ledger.utxo.1.1 instead, and I missed tha fact that it's coming in 5.1. I am not sure at all in terms of the versioning here. So it definitely needs to be in a new changeset. But where does that changeset fall under in terms of versioning? (This change seems to be backwards compatible, so maybe different file under same version?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kyriathar suggested to consult with @LWogan @JamesHR3, what do you guys think?

Copy link
Contributor

@kyriathar kyriathar Jul 10, 2023

Choose a reason for hiding this comment

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

What @JamesHR3 says below is right.

Please disregard my above answer where I managed to blend the database update with the config schema update.

Copy link
Contributor

@blsemo blsemo left a comment

Choose a reason for hiding this comment

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

Please put db changes in separate liquibase change set.

@JamesHR3
Copy link
Collaborator

There's two interesting considerations here: the database upgrade and the config upgrade. Both schema files require some versioning.

For the DB side, I'd suggest that we use a separate changeset file per minor version increment - that makes it easier to track what changes were introduced in what version.

For the config side, I'd suggest the same thing. However, I think @nikinagy ran into a problem across upgrade whereby old versions of the config could get pushed, and so code requiring new versions of the config did not have a value it could use. I'm not sure where discussions got to around solving that.

@nkovacsx
Copy link
Contributor Author

@JamesHR3 I understand we need to suffix the utxo-ledger-config-creation with v1.1 which makes sense. However, how would that be picked up? Do we need a new db.changelog-master.xml? Is there a plan on how these upgrade will work? I feel like there's no clear picture atm.

@nkovacsx
Copy link
Contributor Author

I applied the suggestions made by @kyriathar and renamed the config XML to add-ledger-utxo-config.xml without a version and added it to db.changelog-master.xml.

@lankydan
Copy link
Collaborator

I applied the suggestions made by @kyriathar and renamed the config XML to add-ledger-utxo-config.xml without a version and added it to db.changelog-master.xml.

Based off the comments, I'm still not sure if the change you made is correct. Can @JamesHR3 @LWogan @kyriathar jump in here? Who officially owns the config part of the code, we should make sure this is documented because its not clear what is supposed to happen here.

@lankydan
Copy link
Collaborator

@blsemo @driessamyn Does anyone know who owns configuration? This PR has been blocked for a couple of weeks now and it is still not clear if @nkovacsx is doing the right thing or not (at least from my perspective).

We can merge our change as it is, but if it's wrong, it is unlikely to ever be corrected unless the owner of configuration knows to deal with it.

If we can't reach a decision on this in the coming week, then I suggest we close this PR and @nkovacsx can hardcode the appropriate default batch size directly into the code and then we'll raise a ticket to address the configuration part whenever we receive guidance on how to achieve this.

@driessamyn
Copy link
Member

@blsemo @driessamyn Does anyone know who owns configuration? This PR has been blocked for a couple of weeks now and it is still not clear if @nkovacsx is doing the right thing or not (at least from my perspective).

We can merge our change as it is, but if it's wrong, it is unlikely to ever be corrected unless the owner of configuration knows to deal with it.

If we can't reach a decision on this in the coming week, then I suggest we close this PR and @nkovacsx can hardcode the appropriate default batch size directly into the code and then we'll raise a ticket to address the configuration part whenever we receive guidance on how to achieve this.

@lankydan , best to check with @simon-johnson-r3 about the implications on upgrade.
I think we have a todo item to publish some guidance.

blsemo
blsemo previously approved these changes Jul 18, 2023
Copy link
Contributor

@blsemo blsemo left a comment

Choose a reason for hiding this comment

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

LGTM

@simon-johnson-r3
Copy link
Contributor

simon-johnson-r3 commented Jul 21, 2023

Hi, sorry for the late reply, I've been trying to gather background on some of our file structures and reasoning behind them.

I've created a document here, it's a bit rushed right now, but it should detail the information you need on the database side and it will be our process going forward: https://r3-cev.atlassian.net/wiki/spaces/CB/pages/4562256029/Corda+5+Upgrade+Developer+Knowledge+Base+-+Making+Database+Schema+Changes

On the Config side, for now there is no document (it's WIP) however I believe what you have here is in line with our thinking. That is you can create new config, you must assign default values (such that old config from before any upgrade can be assigned a value) but cannot delete or alter existing config at all to maintain compatibility from previous versions.

So as far as this review goes, you will need to make a minor change on the db side only. Please refer to the doc on that - part of the reason I'm not spelling it out here is so you can let me know if the document doesn't make sense anywhere.

Copy link
Contributor

@simon-johnson-r3 simon-johnson-r3 left a comment

Choose a reason for hiding this comment

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

See general comment.

…nto nandor/CORE-8695/backchain-batch-api

# Conflicts:
#	data/db-schema/src/main/resources/net/corda/db/schema/config/migration/config-creation-v5.1.xml
…nto nandor/CORE-8695/backchain-batch-api

# Conflicts:
#	data/config-schema/src/main/java/net/corda/schema/configuration/LedgerConfig.java
@nkovacsx nkovacsx merged commit 0376efe into release/os/5.1 Aug 24, 2023
1 check passed
@nkovacsx nkovacsx deleted the nandor/CORE-8695/backchain-batch-api branch August 24, 2023 07:11
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.

8 participants