From 02e48fffcc64528f206b34664a16e827157a2061 Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Tue, 5 Dec 2023 10:16:40 +0000 Subject: [PATCH] Swap magic bytes for something more descriptive This also has the benefit of not causing problems on old versions of MySQL, which broke with the emoji version. --- cmd/createtree/main.go | 2 +- storage/mysql/tree_storage.go | 2 +- storage/testonly/admin_storage_tester.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/createtree/main.go b/cmd/createtree/main.go index e722c03e32..0c1b86d96f 100644 --- a/cmd/createtree/main.go +++ b/cmd/createtree/main.go @@ -104,7 +104,7 @@ func newRequest() (*trillian.CreateTreeRequest, error) { TreeState: trillian.TreeState(ts), TreeType: trillian.TreeType(tt), DisplayName: *displayName, - Description: "🙃norevs🙃 " + *description, + Description: "[NO_SUBTREE_REVISIONS] " + *description, MaxRootDuration: durationpb.New(*maxRootDuration), }} klog.Infof("Creating tree %+v", ctr.Tree) diff --git a/storage/mysql/tree_storage.go b/storage/mysql/tree_storage.go index 7047ff988a..b7b2660b9d 100644 --- a/storage/mysql/tree_storage.go +++ b/storage/mysql/tree_storage.go @@ -159,7 +159,7 @@ func (m *mySQLTreeStorage) beginTreeTx(ctx context.Context, tree *trillian.Tree, } // If the tree description starts with magic constant then we will only write a single // revision for each subtree tile, which simplifies the reading query. - subtreeRevs := !strings.HasPrefix(tree.Description, "🙃norevs🙃") + subtreeRevs := !strings.HasPrefix(tree.Description, "[NO_SUBTREE_REVISIONS]") return treeTX{ tx: t, mu: &sync.Mutex{}, diff --git a/storage/testonly/admin_storage_tester.go b/storage/testonly/admin_storage_tester.go index e88e5607c5..419be00ee2 100644 --- a/storage/testonly/admin_storage_tester.go +++ b/storage/testonly/admin_storage_tester.go @@ -47,7 +47,7 @@ var ( TreeState: trillian.TreeState_ACTIVE, TreeType: trillian.TreeType_LOG, DisplayName: "Llamas Log", - Description: "🙃norevs🙃 Registry of publicly-owned llamas", + Description: "[NO_SUBTREE_REVISIONS] Registry of publicly-owned llamas", MaxRootDuration: durationpb.New(0 * time.Millisecond), }