frostdb icon indicating copy to clipboard operation
frostdb copied to clipboard

panic: Duplicate registration

Open thorfour opened this issue 1 year ago • 1 comments

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.

thorfour avatar Jan 30 '24 02:01 thorfour

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.

github-actions[bot] avatar Mar 01 '24 01:03 github-actions[bot]