Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1992698 - Store certain parts of dynflow data as msgpack
Summary: Store certain parts of dynflow data as msgpack
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Dynflow
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: Adam Ruzicka
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-11 15:24 UTC by Adam Ruzicka
Modified: 2022-07-05 14:29 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-dynflow-1.6.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:29:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Dynflow dynflow pull 359 0 None None None 2021-08-11 15:25:33 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:29:49 UTC

Description Adam Ruzicka 2021-08-11 15:24:22 UTC
Description of problem:
Dynflow currently stores some of its data inefficiently, moving to a binary format can make dynflow tables more compact and make dynflow a tiny bit faster. For details see the original thread[1].

[1] - http://mailman-int.corp.redhat.com/archives/satellite-eng/2020-June/msg00032.html

Comment 3 Lukáš Hellebrandt 2022-02-09 11:04:57 UTC
Verified with Sat 6.10.1 upgraded to Sat 7.0 snap 8.0.

On the Satellite after upgrade:
Tasks run, jobs run.
```
SELECT table_name, column_name, data_type FROM information_schema.columns WHERE table_name = 'dynflow_execution_plans';
       table_name        |    column_name    |          data_type          
-------------------------+-------------------+-----------------------------
 dynflow_execution_plans | uuid              | uuid
 dynflow_execution_plans | data              | text
 dynflow_execution_plans | state             | text
 dynflow_execution_plans | result            | text
 dynflow_execution_plans | started_at        | timestamp without time zone
 dynflow_execution_plans | ended_at          | timestamp without time zone
 dynflow_execution_plans | real_time         | double precision
 dynflow_execution_plans | execution_time    | double precision
 dynflow_execution_plans | label             | text
 dynflow_execution_plans | class             | text
 dynflow_execution_plans | root_plan_step_id | integer
 dynflow_execution_plans | run_flow          | bytea
 dynflow_execution_plans | finalize_flow     | bytea
 dynflow_execution_plans | execution_history | bytea
 dynflow_execution_plans | step_ids          | bytea
(15 rows)
```

Comment 5 Lukáš Hellebrandt 2022-04-12 09:40:44 UTC
# export PGPASSWORD=$(grep password /etc/foreman/database.yml | cut -d\" -f2)

# timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select encode(dynflow_execution_plans.execution_history, 'escape') from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | tail -n 2
\223\203\244time\316b\244name\245delay\250world_id\331$32f7e466-d6d8-4e55-b2db-7ec1f7642951\203\244time\316bSo\221\244name\257start execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d\203\244time\316bSo\333\244name\260finish execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d
\223\203\244time\316bP\314\222\244name\245delay\250world_id\331$32f7e466-d6d8-4e55-b2db-7ec1f7642951\203\244time\316bR\244name\257start execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d\203\244time\316bR\244name\260finish execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d

# timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select dynflow_execution_plans.execution_history from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | tail -n 2
\x9383a474696d65ce62521e08a46e616d65a564656c6179a8776f726c645f6964d92433326637653436362d643664382d346535352d623264622d37656331663736343239353183a474696d65ce62536f91a46e616d65af737461727420657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d30613138653839653537316483a474696d65ce62536fdba46e616d65b066696e69736820657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d306131386538396535373164
\x9383a474696d65ce6250cc92a46e616d65a564656c6179a8776f726c645f6964d92433326637653436362d643664382d346535352d623264622d37656331663736343239353183a474696d65ce62521e05a46e616d65af737461727420657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d30613138653839653537316483a474696d65ce62521e05a46e616d65b066696e69736820657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d306131386538396535373164

Last entry converted (https://toolslick.com/conversion/data/messagepack-to-json) is:

[
  {
    "time": 1649462418,
    "name": "delay",
    "world_id": "32f7e466-d6d8-4e55-b2db-7ec1f7642951"
  },
  {
    "time": 1649548805,
    "name": "start execution",
    "world_id": "b7b400c3-11e0-4cf6-af5b-0a18e89e571d"
  },
  {
    "time": 1649548805,
    "name": "finish execution",
    "world_id": "b7b400c3-11e0-4cf6-af5b-0a18e89e571d"
  }
]

Comment 8 errata-xmlrpc 2022-07-05 14:29:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.