gristlabs_grist-core/app
Paul Fitzpatrick 2feef7f780 (core) avoid typeorm's .save() method for relation with multi-column primary key
Summary:
A recently added stress test ("deletes documents reasonably quickly" in removedAt.ts) is sporadically failing under postgres.  It looks like typeorm's .save() method is in some way unreliable when setting a table with multi-column primary keys, via a ManyToMany relation. This diff replaces the .save() with explicit inserts/deletes.

I modified _repairWorkspaceGuests recently, so thought that change might have been the problem. However under the stress test, failures occur as often in _repairOrgGuests (not changed recently) as in _repairWorkspaceGuests (changed recently).

For reference, see schema diagram at https://grist.quip.com/wWpRAMe058Nl/Home-DB (the table being updated is `group_users`).

Possibly related issue: https://github.com/typeorm/typeorm/issues/4122

Test Plan:
After this change, stress test runs well on postgres locally (no failure 70 iterations); before it would fail on postgres within 3 iterations typically.

Separately: I gave a test that failed a little more time to return, and confirmed it was no slower on average, so I think it was unrelated.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D2848
2021-06-04 13:58:22 -04:00
..
client (core) updates from grist-core 2021-06-01 13:19:22 -04:00
common (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
gen-server (core) avoid typeorm's .save() method for relation with multi-column primary key 2021-06-04 13:58:22 -04:00
plugin (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
server (core) speed up a step in document deletion 2021-06-02 16:06:26 -04:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00