Skip to content

Compaction failure and storage bloat caused by large JSON field in shared-data PRIMARY KEY table #76214

Description

@0akarma

Steps to reproduce the behavior (Required)

  1. Create a shared-data / cloud-native PRIMARY KEY table with large JSON columns, for example:
    CREATE TABLE history (
      id VARCHAR(32) NOT NULL,
      `@dt` DATETIME NOT NULL,
      ts INT(11) NOT NULL,
      doc JSON NOT NULL
    )
    PRIMARY KEY(id)
    PARTITION BY RANGE(`@dt`) (...)
    DISTRIBUTED BY HASH(id) BUCKETS ...
    PROPERTIES ("replication_num" = "1");
  2. Insert records where the doc column may contain very large JSON values (single row can be > 16MB).
  3. Keep writing / running compaction on the table.
  4. Observe FE log during compaction and autovacuum.

Expected behavior (Required)

  • Compaction should complete normally for the table/partitions.
  • Autovacuum should be able to reclaim obsolete files.
  • Object storage usage should gradually decrease after data becomes inactive.

Real behavior (Required)

  • Compaction repeatedly fails for some partitions with: Compaction job txnId=... failed: string length(...) > limit(1048576)
  • AutovacuumDaemon keeps running, but vacuumedFiles=0 / vacuumedFileSize=0 for affected partitions.
  • The table's storage path keeps accumulating many small objects / historical files.
  • Object storage usage stays much larger than the visible table size.

Additional context

  • The table is a shared-data / cloud-native PRIMARY KEY table.
  • The table contains large JSON columns, especially doc.
  • SHOW TABLET reports MinVersion = 0 for tablets, so the issue does not look like tablet version retention.
  • This looks like compaction cannot handle oversized stringified metadata / payload for some partitions, which prevents file merging and cleanup.

StarRocks version (Required)

  • You can get the StarRocks version by executing SQL select current_version()
current_version()|
-----------------+
4.0.6-45fdede    |

Metadata

Metadata

Assignees

Labels

type/bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions