Honor inherited ownership when finishing prepared transactions

Started by Kirill Reshkeabout 4 hours ago1 messageshackers
Jump to latest
#1Kirill Reshke
reshkekirill@gmail.com

Recently started to use 2pc support in SPQR [0]https://github.com/pg-sharding/spqr for transactions that
need to modify data on several postgres(shards). So, for partially
committed 2pc we have a separate watchdog which finishes all half-done
transactions.

And we want a separate role for this watchdog. But this just fails to
finish transactions that were prepared. The reason is a two phase
check that compares user oid with tx owner oid with ==. This was the
original security restriction from [1]Discussion: /messages/by-id/15495.1097685302@sss.pgh.pa.us (valid at time), but didn't
change after [2]Discussion: /messages/by-id/26627.1119985659@sss.pgh.pa.us. Before [2]Discussion: /messages/by-id/26627.1119985659@sss.pgh.pa.us, server had logic that only user himself
can do something with his object, for example dropping the table was
ONLY for owner. After [2]Discussion: /messages/by-id/26627.1119985659@sss.pgh.pa.us, it use role membership etc. So, can we use
same in 2pc (prepared) tx? Is [1]Discussion: /messages/by-id/15495.1097685302@sss.pgh.pa.us sec restriction still true? I have
simple patch for this, didn't posted yet, want to hear back

[1]: Discussion: /messages/by-id/15495.1097685302@sss.pgh.pa.us
[2]: Discussion: /messages/by-id/26627.1119985659@sss.pgh.pa.us

[0]: https://github.com/pg-sharding/spqr

--
Best regards,
Kirill Reshke