Fix error handling for chunk cache config check in __conn_config_file

XMLWordPrintableJSON

    • Storage Engines, Storage Engines - Persistence
    • SE Persistence backlog
    • None

      Deprecated chunk cache config is checked in __conn_chunk_cache_check, which is called from two places:

      • wiredtiger_open — validates the user-supplied config string passed at open time.
      • __conn_config_file — validates the on-disk WiredTiger.basecfg that WiredTiger wrote when the database was created.

      When chunk cache is enabled on an older WT version, chunk_cache=(enabled=true,...) is persisted into WiredTiger.basecfg. On upgrade to a version where chunk cache is deprecated, __conn_chunk_cache_check returns EINVAL with the message "chunk cache has been deprecated and is no longer supported, chunk_cache configuration should be removed from WiredTiger.basecfg"

      However, the err: block in __conn_config_file (conn_api.c:1742-1745) treats any EINVAL from a basecfg read as evidence of file corruption: it sets WT_CONN_DATA_CORRUPTION and returns WT_ERROR. The connection close path later escalates that to WT_TRY_SALVAGE. As a result, the final error surfaced to the caller is WT_TRY_SALVAGE: database corruption detected, even though the database is healthy and the basecfg was written by WiredTiger itself. This corruption alarm may trigger an unnecessary salvage/restore procedure.

      This ticket fixes the misleading error so that chunk cache deprecation on upgrade surfaces as a clear EINVAL with the deprecation message, without tripping the basecfg corruption detection path. 

            Assignee:
            Jasmine Bi
            Reporter:
            Jasmine Bi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: