frostdb
frostdb copied to clipboard
panic: Duplicate registration
In a couple places in db.go
we call newTable(...)
which registers metrics under that table's name.
But before adding that table into the database we call newTableBlock(...)
which can return an error. Which then leaves us in a state where that table isn't in the database but it's metrics have been registered and on the next attempt to create that table it panics.
https://github.com/polarsignals/frostdb/blob/ab6b4914523d5f1961c294f14e3af28ebed13376/db.go#L818-L836
We should prevent this scenario from happening. Either somehow call newTableBlock
before newTable
or split metrics registration out and call it after.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.