Skip to content

Add an optimized QueueLeaves implementation for single-leaf batches in the PostgreSQL storage backend#3769

Merged
roger2hk merged 5 commits intogoogle:masterfrom
robstradling:postgres_queueleaf
Apr 23, 2025
Merged

Add an optimized QueueLeaves implementation for single-leaf batches in the PostgreSQL storage backend#3769
roger2hk merged 5 commits intogoogle:masterfrom
robstradling:postgres_queueleaf

Conversation

@robstradling
Copy link
Copy Markdown
Contributor

@robstradling robstradling commented Apr 2, 2025

The current QueueLeaves implementation for PostgreSQL is optimised for sequencing large batches, but the approach it takes (temporary tables, and table locks to prevent concurrent operations on the LeafData and Unsequenced tables) imposes overheads that make it perform fairly poorly when sequencing small batches. We've found that this is a pain point for our PostgreSQL-based Tiger and Elephant CT log shards that are now seeing a significant rate of submissions.

AIUI, Trillian's CT persona only ever calls QueueLeaves for batches containing a single-leaf. i.e., one QueueLeaves operation per add-chain or add-pre-chain request.

This PR incorporates an alternative "QueueLeaf" implementation for PostgreSQL that's used for and optimised for single-leaf batches. We deployed this to our Tiger and Elephant log shards about a week ago, and the results have been very promising.

Checklist

@robstradling robstradling requested a review from a team as a code owner April 2, 2025 13:25
@robstradling robstradling requested a review from mhutchinson April 2, 2025 13:25
@roger2hk
Copy link
Copy Markdown
Contributor

roger2hk commented Apr 2, 2025

/gcbrun

@robstradling robstradling mentioned this pull request Apr 9, 2025
2 tasks
@roger2hk
Copy link
Copy Markdown
Contributor

/gcbrun

@roger2hk roger2hk merged commit e6be87d into google:master Apr 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants