Allow StorageExtension to extend DuckCatalog implementation in order to integration with observability system #10643
+50
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Today, Virtual Catalogs allow extensions to supply their own implementation of a catalog and transaction system. This is great and allows things like SQLLite and Postgres to be brought into the DuckDB universe. That said, sometimes an extension just want to extend the DuckDB catalog a little bit. Specifically - we would like to add observability (metrics + logs) to the transaction manager. To do so, the storage extension returns a DuckCatalog instance as a catalog and a class that's derived from DuckTransactionManager. That would work nicely except, today, DuckDB doesn't instantiate the storage manager and expects the storage extension to supply that functionality in its catalog implementation.
This PR changes this behavior to instantiate a storage manager instance (or not) if the catalog that's returned is a subclass of DuckCatalog (which relies on the Storage Manager to work).
Next to that, I added a hook in the DuckTransactionManager to expose some insight into the class's decision to checkpoint (or not) during transaction commit.