Skip to content

More robustness around deprecated extension settings#18353

Merged
Mytherin merged 2 commits intoduckdb:v1.3-ossivalisfrom
carlopi:deprecated_settings
Jul 23, 2025
Merged

More robustness around deprecated extension settings#18353
Mytherin merged 2 commits intoduckdb:v1.3-ossivalisfrom
carlopi:deprecated_settings

Conversation

@carlopi
Copy link
Contributor

@carlopi carlopi commented Jul 22, 2025

Current situation

Mechanism for autoloading setting currently assumes a given extension is stable over time and always provide the same set of settings (or that they grow over time, adding them is fine).
While this is currently true, as far as I am aware, it might not something we want (or can) guarantee moving forward.

Currently, if you were to remove a setting from an extension, compile it from a duckdb version that assumes the setting to be there, and allow autoloading:

SET autoload_known_extensions = true;
SET some_setting_that_trigger_autoloading_but_not_anymore_in_the_extension = true;
zsh: segmentation fault  ./build/release/duckdb

while with assertion enabled it would be caught by:

D_ASSERT(entry != config.extension_parameters.end());

Proposed change

This PR turns the assertion in a runtime InternalException, that is strictly better than segfault.

Open questions/1: InternalException or InvalidInputException

We could consider move InternalException to InvalidInputException, problem is that executing the SQL still has the side effect of autoinstall / autoloading the extension, so it would be handy to broadcast that to the user (and while InternalException are always rethrown, that's not true for other exception types).

Open questions/2: how to test

Code is more or less trivial, problem is that this is very hard to test without extra infrastructure.
What I did locally was compile on a hash where httpfs extension was available, so to be able to use default httpfs we ship, add a phantom setting via:

diff --git a/src/include/duckdb/main/extension_entries.hpp b/src/include/duckdb/main/extension_entries.hpp
index f15f9ea62d..b0a611268e 100644
--- a/src/include/duckdb/main/extension_entries.hpp
+++ b/src/include/duckdb/main/extension_entries.hpp
@@ -1041,6 +1041,7 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
     {"s3_url_compatibility_mode", "httpfs"},
     {"s3_url_style", "httpfs"},
     {"s3_use_ssl", "httpfs"},
+    {"some_setting", "httpfs"},
     {"sqlite_all_varchar", "sqlite_scanner"},
     {"sqlite_debug_show_queries", "sqlite_scanner"},
     {"timezone", "icu"},

and then check behaviour of:

SET autoload_known_extensions=1;
SET some_setting = true;

or

SET autoload_known_extensions=1;
RESET some_setting;

@carlopi carlopi changed the title More robustness around deprecated settings More robustness around deprecated extension settings Jul 22, 2025
@Mytherin Mytherin merged commit c816485 into duckdb:v1.3-ossivalis Jul 23, 2025
49 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Jul 23, 2025
More robustness around deprecated extension settings (duckdb/duckdb#18353)
Enable stack traces on linux for bundled libraries (duckdb/duckdb#18363)
Re-enable url-encode test (duckdb/duckdb#18360)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Jul 23, 2025
More robustness around deprecated extension settings (duckdb/duckdb#18353)
Enable stack traces on linux for bundled libraries (duckdb/duckdb#18363)
Re-enable url-encode test (duckdb/duckdb#18360)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
@carlopi carlopi deleted the deprecated_settings branch August 17, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants