-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
1588 - remove jsonb from Schema & add config #1700
Conversation
Looks like the tests are failing on macOS. You might want to bump the timeout to ~ 6 seconds |
works on my mac m1 max with 64GB of RAM 😂, will change the timeout :) |
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.
Tests are still failing on MacOS, I still suspect it has to do with the slow runners provided by GitHub. I also see some commented-out code. Otherwise, LGTM!
26048f6
to
8eda705
Compare
Some questions to better understand the pr:
|
@@ -92,6 +93,14 @@ metadataValueToJsonNoSchema = conv | |||
. Aeson.Text.encodeToLazyText | |||
$ conv v | |||
|
|||
txMetadataValueToText :: TxMetadataValue -> Text |
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.
Should this be removed?
Going to test that out today
The unicode automatically get converted by postgresql when changing the data type from
I thought the reasoning behind this was to improve speeds as
The problem being if a user wants to have |
To elaborate on my question. For jsonb type, we need to run checks, like
Yes the motivation of changing jsonb is syncing speed. However the pr only allows a migration towards one direction. What is the motivation for this restriction? |
3c16a73
to
b401102
Compare
b401102
to
568f097
Compare
Adding and removing jsonb datatype from DB was tested on full database on mainnet. Each transaction took around 5 minutes, which is was reasonable. |
d2ce4a0
to
758d311
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!
@Cmdv did you figure this out?
Since it's not clear if this fixes the dropped metadata issue, let's not change the default, ie enable jsonb by default. Users will be able to disable them by adding the config. This looks good otherwise. |
So you're saying remove the migrations files and have it default to the db having jsonb and if the user doesn't want it then they need to use the config? |
Yes, I assume it won't be too big of a change? |
758d311
to
0b9de55
Compare
Description
This issue fixes #1588
functionality taken from documentation:
Add Jsonb To Schema
add_jsonb_to_schema
Jsonb data types were removed from the schema to improve inserting performance, but if required, they can be reintroduced by enabling this config.
cardano-db-sync
will throw an error if
add_jsonb_to_schemawas previously set to
enableand then either removed from the configuration file or set to
disabled`.string
enum: The value of this property must be equal to one of the following values:
"enable"
"disable"
Example
Data Types Effected
When enabling this config, the following tables and columns will be set with the
jsonb
data type:tx_metadata
json
script
json
datum
value
redeemer_data
value
cost_model
costs
gov_action_proposal
description
off_chain_pool_data
json
off_chain_vote_data
json
Checklist
fourmolu
on version 0.10.1.0 (which can be run withscripts/fourmolize.sh
)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.