-
-
Notifications
You must be signed in to change notification settings - Fork 170
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 upgrade notes entry on optional field data migration utility script #1071
Conversation
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.
A few minor nitpicks. But I'm fine if we merge without these changes.
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
* The underlying database field type for storing large values such as action execution result has | ||
changed for various database models (ActionExecutionDB, LiveActionDB, WorkflowExecutionDB, | ||
TaskExecutionDB, TriggerInstanceDB). | ||
|
||
For most users this change will result in 8-20x speed up when working with (reading and writing) | ||
large values from / to the database. | ||
|
||
The change is fully transparent to the end user and new objects created after upgrade to |st2| | ||
v3.5 will automatically utilize this new field type. | ||
|
||
Existing objects in the database will continue to utilize old field type. | ||
|
||
If you want to migrate them to the new field type, you can use | ||
``st2-migrate-db-dict-field-values`` migration script which ships with |st2| v3.5. The script | ||
only operates on "finalized" objects (i.e. finished executions) and it's idempotent which means | ||
you can re-run it on failures or similar. | ||
|
||
It's worth noting that running this script is optional - in most cases users primarily care about | ||
performance for recent / new objects (e.g. viewing recent executions) so if you don't migrate | ||
existing database field values this means retrieving those objects will still be slow, but it | ||
doesn't affect newly created objects post v3.5 upgrade which will utilize new field type and | ||
as such, exhibit much better performance. | ||
|
||
By default the script will run in an interactive mode and display a prompt with a warning which needs | ||
to be acknowledged before continuing. If you want to run script in an non-interactive mode, pass | ||
``--yes`` command line argument to it. | ||
|
||
The script also defaults to migrating data for the past 30 days. You can migrate objects from | ||
a different time period using ``--start-dt`` and ``--end-dt`` arguments as shown below. | ||
|
||
The script currently doesn't support batching so in case you have many objects in the database | ||
(especially trigger instances) you may need to migrate things in smaller chunks and call this | ||
script multiple time (e.g. using a day long intervals or shorter). | ||
|
||
Before running this script, you may also want to purge some old operational data. For information | ||
on that, please refer to :doc:`Purging Old Operational Data </troubleshooting/purging_old_data>` | ||
documentation page. | ||
|
||
.. code-block:: bash | ||
|
||
# Migrate objects with creation date between April 20th, 2021 and April 25th, 2021 | ||
/opt/stackstorm/st2/bin/st2-migrate-db-dict-field-values --start-dt "2021-04-20T19:16:55Z" --end-dt "2021-04-25T19:26:55Z" | ||
|
||
# Migrate object between April 20th and "now" | ||
/opt/stackstorm/st2/bin/st2-migrate-db-dict-field-values --start-dt "2021-04-20T19:16:55Z" --end-dt "now" | ||
|
||
.. note:: | ||
|
||
You are strongly recommended to create a full database backup before running this script. | ||
|
||
If you run this migration script and a need arises, you won't be able to rollback back to a | ||
previous version (v3.4) because code in previous version doesn't include support for this new | ||
field type (in such case you would need to restore the database backup). |
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.
@Kami The upgrade note looked "little big" though :)
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.
Yeah, I think it's better to give more context than less.
I always hate when there is a regression / issue with a new version of some project / library and changelog / upgrade notes don't give much clue where to begin and then you need start going over the commits immediately which means more wasted time...
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.
Thanks @Kami and @cognifloyd 👍
Upgrade notes entry for optional migration script in StackStorm/st2#5255.