Skip to content

Create iceberg table takes too long #1907

Open

Description

@DimensionWieldr

Describe the bug
It takes very long to create an iceberg table.

To Reproduce
Steps to reproduce the behavior:

  1. Create an iceberg table
CREATE TABLE ice.`default.metadata_testing`
(
    `event_month` Int32
)
ENGINE = Iceberg('s3://protvjoe-1lfyj7kp-iceberg/default/metadata_testing')
PARTITION BY event_month

Query id: 89cf073c-d471-419d-b106-5ad581ff8ad0

Ok.

0 rows in set. Elapsed: 33.453 sec.

Expected behavior
Create table shouldn't take 30+ seconds.

Key information
Provide relevant runtime details.

  • 26.3.10.20001 Antalya
  • Iceberg table is on ice rest catalog on ACM dev
  • In the example, ice is a database created with ENGINE = DataLakeCatalog

Activity

  1. added
    performance
    on Jun 12, 2026
  2. changed the title [-]Ice rest catalog takes too long[/-] [+]Create iceberg table takes too long[/+] on Jun 15, 2026
  3. subkanthi commented on Jun 16, 2026

    @subkanthi
    Collaborator

    A namespace already exists error is not handled and CH server seems to keep retrying in loop.

    2026-06-16 22:03:45 [00605369-36] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:45 [00605369-36] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:45 [00605369-34] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:45 [00605369-34] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:45 [00605369-36] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:45 [00605369-36] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:46 [00605369-34] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:46 [00605369-34] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:46 [00605369-36] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:46 [00605369-36] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:48 [00605369-34] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:48 [00605369-34] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:51 [00605369-36] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:51 [00605369-36] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    2026-06-16 22:03:58 [00605369-34] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces
    2026-06-16 22:03:58 [00605369-34] WARN c.a.i.r.c.i.r.RESTCatalogServlet > @token POST v1/namespaces: Namespace already exists: my_schema
    
  4. subkanthi commented on Jun 16, 2026

    @subkanthi
    Collaborator

    createNamespaceIfNotExists function does not handle 409 HTTP error.
    http_max_tries is the number of times it retries.

    void RestCatalog::createNamespaceIfNotExists(const String & namespace_name, const String & location) const
    {
        const std::string endpoint = base_url / config.prefix / "namespaces";
    
        Poco::JSON::Object::Ptr request_body = new Poco::JSON::Object;
        {
            Poco::JSON::Array::Ptr namespaces = new Poco::JSON::Array;
            namespaces->add(namespace_name);
            request_body->set("namespace", namespaces);
        }
        {
            Poco::JSON::Object::Ptr properties = new Poco::JSON::Object;
            properties->set("location", location);
            request_body->set("properties", properties);
        }
    
        try
        {
            ProfileEvents::increment(ProfileEvents::DataLakeRestCatalogCreateNamespace);
            auto timer = DB::CurrentThread::getProfileEvents().timer(ProfileEvents::DataLakeRestCatalogCreateNamespaceMicroseconds);
            sendRequest(endpoint, request_body);
        }
        catch (...)
        {
            DB::tryLogCurrentException(log);
        }
    }
    
  5. self-assigned this
    on Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

antalyaperformance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions