-
Notifications
You must be signed in to change notification settings - Fork 9
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-13621 Idempotency id table definition #1222
CORE-13621 Idempotency id table definition #1222
Conversation
5e4f712
to
a54e444
Compare
Jenkins build for PR 1222 build 9 Build Successful: |
a54e444
to
61f4833
Compare
61f4833
to
d6c774e
Compare
f345126
to
ad613b3
Compare
<column name="request_id" type="NVARCHAR(255)"> | ||
<constraints nullable="false" primaryKey="true"/> | ||
</column> | ||
</createTable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the cleanup strategy for this table?
Would it not be useful to have a timestamp column that can be used for partitioning and/or cleanup?
Given it is insert only, I suspect it would be very cheap to have a DB auto-populated timestamp column, but we could check with @ifrankrui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cleanup strategy will be done in follow-up work. This PR only introduces the part of the deduplication table (the request ids) needed to deduplicate the persistence requests (in corda/corda-runtime-os#4491).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But do we have a design yet for the clean-up strategy?
I'm a bit uncomfortable with merging something in which we know will cause problems, without a plan for how we will mitigate it.
And if we know what the design will be, we may as well get the DB structure correct from the get-go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you already include the housekeeping strategy here?
Yes, you could have a timestamp column for the deduplication table and populate the timestamp as a part of the insert request. However, I would not recommend using DB auto-populated timestamp column. They are implemented differently between databases and there isn't one simple way to define them in Liquibase change log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there isn't one simple way to define them in Liquibase change log.
@ifrankrui I'm interested in this comment. Why is that?
We do this in a number of places already (e.g.:
Line 6 in 9ea9852
<property name="now" value="now()" dbms="hsqldb"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driessamyn As pointed out in the above changelog, you have to define an extra property for one type of database when you support multiple database types. If you populate the timestamp column as a part of a persistence request, then you don't need these Liquibase properties.
ad613b3
to
77afe26
Compare
77afe26
to
f3c1624
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -6,5 +6,11 @@ | |||
<addColumn tableName="vnode_member_info"> | |||
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false"/> | |||
</addColumn> | |||
|
|||
<createTable tableName="vnode_persistence_request_id"> | |||
<column name="request_id" type="NVARCHAR(255)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just passing by, but I wonder if NVARCHAR(36) would be suffice as I think a UUID fits in it? I guess it depends how we build the idempotency ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only store the UUID.toString()
in it. Will take a look to see if we can shorten the DB field.
Introduces table in vnode-vault schema which holds executed persistence requests (ids) from
PersistenceService
, to be used for deduplicating them.runtime-os PR: #4491