cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.93k stars 1.78k forks source link

cubejs-worker: duplicate trigger for same pre-agg refresh #5735

Open kaja78 opened 1 year ago

kaja78 commented 1 year ago

Describe the bug We can see sporadic pre-agg refresh error caused by duplicate attempts to refresh the same main pre-agg table at the same time.

image

error: relation "org_b_main_22w1fioj_1rxs3lep_1hot17r" already exists
    at Parser.parseErrorMessage (/cube/node_modules/pg-protocol/src/parser.ts:369:69)
    at Parser.handlePacket (/cube/node_modules/pg-protocol/src/parser.ts:188:21)
    at Parser.parse (/cube/node_modules/pg-protocol/src/parser.ts:103:30)
    at Socket.<anonymous> (/cube/node_modules/pg-protocol/src/index.ts:7:48)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Version: 0.31.20

Additional context CUBEJS_CONCURRENCY: 8

paveltiunov commented 1 year ago

@kaja78 Are you using external Postgres as pre-aggregations storage?

kaja78 commented 1 year ago

No internal. We are using originalSql for main pre-aggs and useOriginalSqlPreAggregations option for rollups.