Kouhei Sutou 2019-02-14 17:26:46 +0900 (Thu, 14 Feb 2019) Revision: d2905f9e01c93ccbf0ca32904ac8c48d8affc7c2 https://github.com/groonga/groonga/commit/d2905f9e01c93ccbf0ca32904ac8c48d8affc7c2 Message: ii: add an environment variable for developers GRN_II_DUMP_INDEX_SOURCE_ON_MERGE=yes dumps source buffer and chunks at the end of buffer_merge(). Modified files: lib/ii.c Modified: lib/ii.c (+17 -0) =================================================================== --- lib/ii.c 2019-02-14 17:20:17 +0900 (023b93eb4) +++ lib/ii.c 2019-02-14 17:26:46 +0900 (184f15558) @@ -104,6 +104,7 @@ static uint32_t grn_ii_builder_block_threshold_force = 0; static uint32_t grn_ii_max_n_segments_small = MAX_PSEG_SMALL; static uint32_t grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK_SMALL; static int64_t grn_ii_reduce_expire_threshold = 32; +static grn_bool grn_ii_dump_index_source_on_merge = GRN_FALSE; void grn_ii_init_from_env(void) @@ -217,6 +218,18 @@ grn_ii_init_from_env(void) NULL); } } + + { + char grn_ii_dump_index_source_on_merge_env[GRN_ENV_BUFFER_SIZE]; + grn_getenv("GRN_II_DUMP_INDEX_SOURCE_ON_MERGE", + grn_ii_dump_index_source_on_merge_env, + GRN_ENV_BUFFER_SIZE); + if (strcmp(grn_ii_dump_index_source_on_merge_env, "yes") == 0) { + grn_ii_dump_index_source_on_merge = GRN_TRUE; + } else { + grn_ii_dump_index_source_on_merge = GRN_FALSE; + } + } } void @@ -4068,6 +4081,10 @@ buffer_merge(grn_ctx *ctx, grn_ii *ii, uint32_t seg, grn_hash *h, S_SEGMENT - sizeof(buffer_header) - db->header.nterms * sizeof(buffer_term); db->header.nterms_void = nterms_void; + if (grn_ii_dump_index_source_on_merge) { + merge_dump_source(ctx, ii, sb, sc, GRN_LOG_DEBUG); + } + exit : datavec_fin(ctx, dv); datavec_fin(ctx, rdv); -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190214/36f0c1d3/attachment.html>