Page MenuHomePhabricator

Flow stores redundant entries in External Store
Open, LowPublic

Description

This is a pre-existing issue confirmed on master, but I found it while working on T172025: Flow isAllowed gets actual revision text before it is needed.

When you make a null edit (more precisely, create a new revision that uses the same text as the prior revision), it will store a copy in External Store.

(05:40) root@localhost:[wiki]> SELECT HEX(rev_id), rev_type, HEX(rev_type_id), rev_change_type, rev_flags, rev_content, rev_user_id, rev_user_ip, rev_user_wiki, HEX(rev_parent_id) FROM flow_revision ORDER by rev_id DESC LIMIT 2;
+------------------------+----------+------------------------+-----------------+------------------------------+-------------------+-------------+-------------+---------------+---------------
| HEX(rev_id)            | rev_type | HEX(rev_type_id)       | rev_change_type | rev_flags                    | rev_content       | rev_user_id | rev_user_ip | rev_user_wiki | HEX(rev_parent
+------------------------+----------+------------------------+-----------------+------------------------------+-------------------+-------------+-------------+---------------+---------------
| 0576AF07595394F2ABF0D6 | post     | 0576AF06FAFB94F2ABF0D6 | delete-post     | utf-8,html,external,external | DB://external/236 |           1 | NULL        | wiki          | 0576AF06FAFB94
| 0576AF06FAFB94F2ABF0D6 | post     | 0576AF06FAFB94F2ABF0D6 | reply           | utf-8,html,external          | DB://external/235 |           1 | NULL        | wiki          | NULL          
+------------------------+----------+------------------------+-----------------+------------------------------+-------------------+-------------+-------------+---------------+---------------
2 rows in set (0.00 sec)

(05:40) root@localhost:[wiki]> SELECT * FROM external.blobs ORDER by blob_id DESC LIMIT 2;+---------+----------------------------------------------+
| blob_id | blob_text                                    |
+---------+----------------------------------------------+
|     236 | <p data-parsoid='{"dsr":[0,4,0,0]}'>5678</p> |
|     235 | <p data-parsoid='{"dsr":[0,4,0,0]}'>5678</p> |
+---------+----------------------------------------------+
2 rows in set (0.00 sec)

Note it also adds a duplicate 'external' flag.