Skip to content

Table system.hybrid_watermarks already exists when upgrading to 26.3 #2152

Description

@xieandrew

Describe the bug
ClickHouse fails to start when upgrading from Antalya 25.8.16.20002 to Antalya 26.3.13.20001 and an existing system.hybrid_watermarks table was created on 25.8.

Code: 57. DB::Exception: Table system.hybrid_watermarks already exists. (TABLE_ALREADY_EXISTS), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000014253c90
1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000e0f43d8
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000e0f3ccc
3. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x000000000e0f3918
4. DB::DatabaseWithOwnTablesBase::attachTableUnlocked(String const&, std::shared_ptr<DB::IStorage> const&) @ 0x000000001818ef78
5. DB::DatabaseAtomic::attachTable(std::shared_ptr<DB::Context const>, String const&, std::shared_ptr<DB::IStorage> const&, String const&) @ 0x00000000180de018
6. DB::attachSystemTablesServer(std::shared_ptr<DB::Context const>, DB::IDatabase&, bool) @ 0x0000000016908c4c
7. DB::Server::main(std::vector<String, std::allocator<String>> const&) @ 0x00000000145e8080
8. Poco::Util::Application::run() @ 0x000000001f8ceb5c
9. DB::Server::run() @ 0x00000000145d3438
10. mainEntryClickHouseServer(int, char**) @ 0x00000000145d0520
11. main @ 0x000000000e0ec45c
12. ? @ 0x0000000000027400
13. __libc_start_main @ 0x00000000000274d8
 (version 26.3.13.20001.altinityantalya (altinity build)) 

To Reproduce
Steps to reproduce the behavior:

  1. Launch server on Antalya 25.8
  2. Create system.hybrid_watermarks table using the following DLL:
CREATE TABLE system.hybrid_watermarks
(
    `table` String COMMENT 'Table in form database.table',
    `watermark` Date
)
ENGINE = KeeperMap('/hybrid_watermarks')
PRIMARY KEY `table`
  1. Upgrade to 26.3
  2. See error

Expected behavior
ClickHouse should start either by recognizing the existing table or replacing it.

Key information
Provide relevant runtime details.

  • 25.8.16.20002 to Antalya 26.3.13.20001
  • Altinity.Cloud AWS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions