Skip to content

Storage API Changes, Schema Tweaks

Compare
Choose a tag to compare
@Martin2112 Martin2112 released this 01 Mar 11:16
· 2248 commits to master since this release
7d73671

Note: A large number of storage related API changes have been made in this release. These will probably only affect developers writing their own storage implementations.

A new tree type ORDERED_LOG has been added for upcoming mirror support. This requires a schema change before it can be used. This change can be made when convenient and can be deferred until the functionality is available and needed. The definition of the TreeType column enum should be changed to ENUM('LOG', 'MAP', 'PREORDERED_LOG') NOT NULL

Some storage interfaces were removed in #977 as they only had one implementation. We think this won't cause any impact on third parties and are willing to reconsider this change if it does.

The gRPC Log and Map server APIs have new methods InitLog and InitMap which prepare newly created trees for use. Attempting to use trees that have not been initialized will return the FAILED_PRECONDITION error storage.ErrTreeNeedsInit.

The gRPC Log server API has new methods AddSequencedLeaf and AddSequencedLeaves. These are intended to support mirroring applications and are not yet implemented.

Storage APIs have been added such as ReadWriteTransaction which allows the underlying storage to manage the transaction and optionally retry until success or timeout. This is a more natural fit for some types of storage API such as CloudSpanner and possibly other environments with managed transactions.

The older BeginXXX methods were removed from the APIs. It should be fairly easy to convert a custom storage implementation to the new API format as can be seen from the changes made to the MySQL storage.

The GetOpts options are no longer used by storage. This fixed the strange situation of storage code having to pass manufactured dummy instances to GetTree, which was being called in all the layers involved in request processing. Various internal APIs were modified to take a *trillian.Tree instead of an int64.

A new storage implementation has been added for CloudSpanner. This is currently experimental and does not yet support Map trees. We have also added Docker examples for running Trillian in Google Cloud with CloudSpanner.

The maximum size of a VARBINARY column in MySQL is too small to properly support Map storage. The type has been changed in the schema to MEDIUMBLOB. This can be done in place with an ALTER TABLE command but this could very be slow for large databases as it is a change to the physical row layout. Note: There is no need to make this change to the database if you are only using it for Log storage e.g. for Certificate Transparency servers.

The obsolete programs queue_leaves and fetch_leaves have been deleted.