错误:数据分区太多

时间:2016-09-01 12:44:30

标签: vertica

我在vertica.log中看到以下错误:

2016-09-01 15:30:54.007 TM Moveout:0x7f9438012440-a00000001212c3 [Txn] <INFO> Begin Txn: a00000001212c3 'Moveout: Tuple Mover'
2016-09-01 15:30:54.007 TM Moveout:0x7f9438012440-a00000001212c3 [TM] <INFO> Tuple Mover: moving out projection rosing_epg_program_events_super
2016-09-01 15:30:54.017 TM Moveout:0x7f9438012440-a00000001212c3 [EE] <INFO> (a00000001212c3) Moveout projection staging.rosing_epg_program_events_super
2016-09-01 15:30:54.017 TM Moveout:0x7f9438012440-a00000001212c3 [EE] <INFO> (a00000001212c3) TM Moveout: moving out data in WOS for proj "staging.rosing_epg_program_events_super" to epoch 3061
2016-09-01 15:30:54.017 TM Moveout:0x7f9438012440-a00000001212c3 [EE] <INFO> (a00000001212c3) Executing the moveout plan
2016-09-01 15:30:54.040 TM Moveout:0x7f9438012440-a00000001212c3 [EE] <INFO> SortManager found maxMerges 7 too small(64 MB Assigned).
2016-09-01 15:30:54.040 TM Moveout:0x7f9438012440-a00000001212c3 [EE] <INFO> After disabling optimization, maxMerges becomes 15.
2016-09-01 15:30:54.069 TM Moveout:0x7f9438012440-a00000001212c3 [Txn] <INFO> Rollback Txn: a00000001212c3 'Moveout: (Table: staging.rosing_epg_program_events) (Projection: staging.rosing_epg_program_events_super)'
2016-09-01 15:30:54.070 TM Moveout:0x7f9438012440 <LOG> @v_statistic_node0001: 00000/3298: Event Posted: Event Code:14 Event Id:261 Event Severity: Warning [4] PostedTimestamp: 2016-09-01 16:30:54.069887 ExpirationTimestamp: 2016-09-01 16:31:09.069887 EventCodeDescription: Timer Service Task Error ProblemDescription: threadShim: Too many data partitions DatabaseName: statistic Hostname: rosing-vertica.elt.stag.local
2016-09-01 15:30:54.070 TM Moveout:0x7f9438012440 <ERROR> @v_statistic_node0001: {threadShim} 54000/5060: Too many data partitions
        HINT:  Verify that the table partitioning expression is correct
        LOCATION:  handlePartitionKey, /scratch_a/release/16125/vbuild/vertica/EE/Operators/DataTarget.cpp:1478
2016-09-01 15:30:54.070 TM Moveout:0x7f9438012440 [Util] <INFO> Task 'TM Moveout' enabled

似乎我选择错误的字段进行分区,并按照here所述达到了WOS中分区的限制。

任务SELECT do_tm_task('moveout');引发以下错误:

 Task: moveout
(Table: staging.rosing_schema_migrations) (Projection: staging.rosing_schema_migrations_super)
...
(Table: staging.rosing_epg_program_events) (Projection: staging.rosing_epg_program_events_super)
On node v_statistic_node0001:
  ERROR 5060:  Too many data partitions

(1 row)

有人知道如何解决这个问题吗?

更新

我无法从此表中删除分区:

ALTER TABLE rosing_epg_program_events REMOVE PARTITIONING

因为此SQL引发了同样的错误:数据分区太多

更新2

我使用woot回答修复了这个问题。非常感谢你!

以下是我修复它的步骤:

  1. 创建rosing_epg_program_events表的副本:

    CREATE TABLE staging.rosing_epg_program_events2
    LIKE staging.rosing_epg_program_events;
    
  2. 从新表中删除分区:

    ALTER TABLE staging.rosing_epg_program_events2 REMOVE PARTITIONING;
    
  3. 将数据从旧表复制到新表。好像旧表包含在出现问题之前和之后插入的所有(!)数据:

    INSERT /*+ DIRECT */ INTO staging.rosing_epg_program_events2
    SELECT * FROM staging.rosing_epg_program_events;
    
  4. 删除旧表:

    DROP TABLE staging.rosing_epg_program_events;
    
  5. 重命名新表:

    ALTER TABLE staging.rosing_epg_program_events2 RENAME TO rosing_epg_program_events;
    
  6. 针对任何情况运行Moveout操作。现在它工作正常:

    SELECT do_tm_task('moveout');
    
  7. 查看任何案例的最后一个好纪元。现在它显示了实际值:

    SELECT GET_LAST_GOOD_EPOCH();
    SELECT * FROM epochs WHERE epoch_number = 3064; // result of previous command
    
  8. 似乎一切正常。

1 个答案:

答案 0 :(得分:2)

执行CREATE TABLE AS SELECTCREATE TABLE LIKE INCLUDING PROJECTIONS,删除分区,然后INSERT /*+ DIRECT */ SELECT复制数据并删除表格,然后重命名。此外,在创建分区时,请尝试将粒度定位在40个分区以下的某个位置。您没有指定,但如果使用时间戳,请使用公式来提取不太精细的值。例如,要按月执行,请执行:

EXTRACT (year FROM mydate) * 100 + EXTRACT (month FROM mydate)

您不必担心在Vertica的分区中使用公式。它使用字段的最小/最大值,而不是分区键上的直接匹配。