Skip to content

fix(cubestore): RocksStore - migrate table by truncate (unknown tables) - #8053

Merged
ovr merged 3 commits into
masterfrom
fix/cubestore-migrate-by-truncate
Mar 28, 2024
Merged

fix(cubestore): RocksStore - migrate table by truncate (unknown tables)#8053
ovr merged 3 commits into
masterfrom
fix/cubestore-migrate-by-truncate

Conversation

@ovr

@ovr ovr commented Mar 28, 2024

Copy link
Copy Markdown
Member

Hello!

Iterating without an upper bound leads to reading keys from next table, next index. Downgrading can lead to an unknown tableId on migration. Let's skip these errors by using a range iterator.

Debug of fixed version:

2024-03-28 14:22:12,368 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: started
2024-03-28 14:22:12,369 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating table QueueItems from [3, 1] to [2, 1]
2024-03-28 14:22:12,369 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table
row_key Table(QueueItems, 4262)
row_key Table(QueueItems, 4263)
row_key Table(QueueItems, 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index
row_key SecondaryIndex(3329, [15, 249, 59, 57, 253, 112, 86, 67], 4264)
row_key SecondaryIndex(3329, [61, 0, 52, 15, 64, 107, 132, 62], 4262)
row_key SecondaryIndex(3329, [82, 234, 217, 91, 115, 57, 47, 211], 4263)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4262)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4263)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4262)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4263)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index: done (3 rows)
2024-03-28 14:22:12,370 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table: done (3 rows)
2024-03-28 14:22:12,373 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: done

Thanks

@ovr
ovr requested a review from a team as a code owner March 28, 2024 13:26
@vercel

vercel Bot commented Mar 28, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:42pm

@ovr
ovr merged commit 509d895 into master Mar 28, 2024
@ovr
ovr deleted the fix/cubestore-migrate-by-truncate branch March 28, 2024 14:25
@ovr
ovr restored the fix/cubestore-migrate-by-truncate branch March 28, 2024 14:30
@ovr
ovr deleted the fix/cubestore-migrate-by-truncate branch March 28, 2024 16:02
JichaoS referenced this pull request in luabase/cube May 7, 2024
…s) (#8053)

Iterating without an upper bound leads to reading keys from next table, next index. Downgrading can lead to an unknown TableId on migration. Let's skip these errors by using a range iterator.

Debug of fixed version:

```
2024-03-28 14:22:12,368 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: started
2024-03-28 14:22:12,369 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating table QueueItems from [3, 1] to [2, 1]
2024-03-28 14:22:12,369 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table
row_key Table(QueueItems, 4262)
row_key Table(QueueItems, 4263)
row_key Table(QueueItems, 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index
row_key SecondaryIndex(3329, [15, 249, 59, 57, 253, 112, 86, 67], 4264)
row_key SecondaryIndex(3329, [61, 0, 52, 15, 64, 107, 132, 62], 4262)
row_key SecondaryIndex(3329, [82, 234, 217, 91, 115, 57, 47, 211], 4263)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4262)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4263)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4262)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4263)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index: done (3 rows)
2024-03-28 14:22:12,370 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table: done (3 rows)
2024-03-28 14:22:12,373 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: done
```
haechangcho pushed a commit to haechangcho/heartcube that referenced this pull request May 15, 2026
…s) (cube-js#8053)

Iterating without an upper bound leads to reading keys from next table, next index. Downgrading can lead to an unknown TableId on migration. Let's skip these errors by using a range iterator.

Debug of fixed version:

```
2024-03-28 14:22:12,368 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: started
2024-03-28 14:22:12,369 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating table QueueItems from [3, 1] to [2, 1]
2024-03-28 14:22:12,369 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table
row_key Table(QueueItems, 4262)
row_key Table(QueueItems, 4263)
row_key Table(QueueItems, 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index
row_key SecondaryIndex(3329, [15, 249, 59, 57, 253, 112, 86, 67], 4264)
row_key SecondaryIndex(3329, [61, 0, 52, 15, 64, 107, 132, 62], 4262)
row_key SecondaryIndex(3329, [82, 234, 217, 91, 115, 57, 47, 211], 4263)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPath index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4262)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4263)
row_key SecondaryIndex(3330, [214, 173, 163, 218, 121, 228, 186, 124], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefixAndStatus index: done (3 rows)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4262)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4263)
row_key SecondaryIndex(3331, [170, 109, 177, 83, 182, 58, 191, 21], 4264)
2024-03-28 14:22:12,370 TRACE [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from ByPrefix index: done (3 rows)
2024-03-28 14:22:12,370 INFO  [cubestore::metastore::rocks_table] <pid:50477> Migrating by truncating rows from QueueItemRocksTable table: done (3 rows)
2024-03-28 14:22:12,373 TRACE [cubestore::metastore::rocks_store] <pid:50477> Migration for cachestore: done
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants