Skip to content

Commit 18d492e

Browse files
committed
Allow show_chunks to process more than 65535 chunks
1 parent 44e5df1 commit 18d492e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.unreleased/pr_8434

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes: #8434 Allow show_chunks to process more than 65535 chunks

src/chunk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void chunk_scan_ctx_init(ChunkScanCtx *ctx, const Hypertable *ht, const P
134134
static void chunk_scan_ctx_destroy(ChunkScanCtx *ctx);
135135
static void chunk_collision_scan(ChunkScanCtx *scanctx, const Hypercube *cube);
136136
static int chunk_scan_ctx_foreach_chunk_stub(ChunkScanCtx *ctx, on_chunk_stub_func on_chunk,
137-
uint16 limit);
137+
uint64 limit);
138138
static Datum show_chunks_return_srf(FunctionCallInfo fcinfo);
139139
static int chunk_cmp(const void *ch1, const void *ch2);
140140
static int chunk_point_find_chunk_id(const Hypertable *ht, const Point *p);
@@ -1791,7 +1791,7 @@ chunk_collision_scan(ChunkScanCtx *scanctx, const Hypercube *cube)
17911791
* Returns the number of processed chunks.
17921792
*/
17931793
static int
1794-
chunk_scan_ctx_foreach_chunk_stub(ChunkScanCtx *ctx, on_chunk_stub_func on_chunk, uint16 limit)
1794+
chunk_scan_ctx_foreach_chunk_stub(ChunkScanCtx *ctx, on_chunk_stub_func on_chunk, uint64 limit)
17951795
{
17961796
HASH_SEQ_STATUS status;
17971797
ChunkScanEntry *entry;
@@ -2274,7 +2274,7 @@ get_chunks_in_time_range(Hypertable *ht, int64 older_than, int64 newer_than, Mem
22742274

22752275
/* Get all the chunks from the context */
22762276
chunk_scan_ctx.data = &data;
2277-
chunk_scan_ctx_foreach_chunk_stub(&chunk_scan_ctx, chunk_scan_context_add_chunk, -1);
2277+
chunk_scan_ctx_foreach_chunk_stub(&chunk_scan_ctx, chunk_scan_context_add_chunk, 0);
22782278
/*
22792279
* only affects ctx.htab Got all the chunk already so can now safely
22802280
* destroy the context

src/chunk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef struct ChunkScanCtx
102102
const Hypertable *ht;
103103
const Point *point;
104104
unsigned int num_complete_chunks;
105-
int num_processed;
105+
uint64 num_processed;
106106
bool early_abort;
107107
LOCKMODE lockmode;
108108

0 commit comments

Comments
 (0)