trillian icon indicating copy to clipboard operation
trillian copied to clipboard

WIP: PostgreSQL quota manager and storage backend

Open robstradling opened this issue 1 year ago • 6 comments

This PR is based on Trillian's existing MySQL quota manager and storage backend. The first several commits were auto-generated by this script, which forked the existing MySQL code into different directories (whilst preserving the git history) and then did a bunch of search'n'replacing to switch from the database/sql interface to the jackc/pgx interface.

Improving performance is my main reason for using the pgx interface directly. In particular, the pgx interface has allowed me to use PostgreSQL's COPY interface for fast bulk-upserts.

The current status of this PR is that go test in the storage/postgresql directory passes all the tests. (I've not yet attempted to stand up a "proper log"). I figure that now's a good time to share my efforts for wider review. :-)

My motivations for putting together this PR are that (1) I and my colleagues at Sectigo have a fair amount of experience with PostgreSQL, but almost no experience with MySQL/MariaDB; and (2) we suffered a CT log failure earlier this year due to MariaDB corruption after disk space exhaustion, and we are confident that PostgreSQL would not have broken under the same circumstances.

Checklist

  • [ ] I have updated the CHANGELOG.
  • [ ] I have updated documentation accordingly (including the feature implementation matrix).

robstradling avatar Oct 08 '24 13:10 robstradling

/gcbrun

roger2hk avatar Oct 08 '24 13:10 roger2hk

/gcbrun

roger2hk avatar Oct 08 '24 21:10 roger2hk

/gcbrun

mhutchinson avatar Oct 10 '24 08:10 mhutchinson

/gcbrun

mhutchinson avatar Oct 10 '24 09:10 mhutchinson

/gcbrun

mhutchinson avatar Oct 10 '24 09:10 mhutchinson

/gcbrun

roger2hk avatar Oct 15 '24 19:10 roger2hk

/gcbrun

mhutchinson avatar Oct 28 '24 14:10 mhutchinson

/gcbrun

roger2hk avatar Oct 28 '24 19:10 roger2hk

/gcbrun

mhutchinson avatar Oct 29 '24 14:10 mhutchinson

/gcbrun

roger2hk avatar Oct 30 '24 22:10 roger2hk

/gcbrun

mhutchinson avatar Oct 31 '24 10:10 mhutchinson

/gcbrun

mhutchinson avatar Oct 31 '24 12:10 mhutchinson

/gcbrun

mhutchinson avatar Nov 06 '24 10:11 mhutchinson

/gcbrun

mhutchinson avatar Nov 06 '24 17:11 mhutchinson

This is super cool to get PostgreSQL in. Thank you so much for the great contribution, @robstradling! (and thanks @mhutchinson for the review)

roger2hk avatar Nov 07 '24 11:11 roger2hk

Thanks @roger2hk. Adding postgres support for your CTFE 'extra data' storage saving feature is next on my list. :-)

robstradling avatar Nov 07 '24 21:11 robstradling