google / trillian

A transparent, highly scalable and cryptographically verifiable data store.
Apache License 2.0
3.51k stars 375 forks source link

Entries getting added to TreeHead table even if Rekor APIs are not invoked #3548

Open subhamoycomputer opened 5 days ago

subhamoycomputer commented 5 days ago

Hi All,

once we bring up Rekor in our local system, we have seen one unusual behavior. Even though the APIs are not in use, still there are entries getting added to the “TreeHead” table constantly at random periodic intervals. It is hecause of this behavior the data count in TreeHead table is constantly increasing. Is this a known behaviour? Can this be stopped by setting any flags on startup commands ?

roger2hk commented 4 days ago

Did you set the max_root_duration when the tree was created? The default is one hour.

https://github.com/google/trillian/blob/6a1e99f2fffe50e0eea980688ca14edeedaf6b9d/cmd/createtree/main.go#L53

If you follow the Sigstore installation steps, it does not set the max_root_duration in the create_tree command.

subhamoycomputer commented 4 days ago

Thanks for your prompt response.

we did try to bring up createtree with the max_root_duration=0 but still entries are getting added to the TreeHead table.

mhutchinson commented 4 days ago

@subhamoycomputer are new leaves being added (i.e. the tree size is changing), or are you only seeing new tree heads for the same size of tree?

@roger2hk replied assuming that the tree size is not growing. The code that creates new tree heads explicitly checks whether there is work to perform and exits if there are no leaves and the max root interval is 0.

Diagnostics that would be helpful:

subhamoycomputer commented 1 day ago

Thanks for your response.

So this is the first time we installed with no active incoming traffic. I saw in the TreeHead table, new rows are getting added for the same TreeID and TreeSize is 0, only TreeRevision is getting increased by 1 for every new row that is added.