[Groonga-commit] groonga/groonga [master] Withdraw grn_ii_cursor_next() when some chunk reuse is detected.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 4月 10日 (火) 11:39:45 JST


Daijiro MORI	2012-04-10 11:39:45 +0900 (Tue, 10 Apr 2012)

  New Revision: cfca9170a6e50b9ab6d641de62f86b8df34393e5

  Log:
    Withdraw grn_ii_cursor_next() when some chunk reuse is detected.
    
    fixes #1329

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+8 -0)
===================================================================
--- lib/ii.c    2012-04-09 12:55:33 +0900 (ba7fbdc)
+++ lib/ii.c    2012-04-10 11:39:45 +0900 (32cdc3e)
@@ -4161,6 +4161,14 @@ grn_ii_cursor_next(grn_ctx *ctx, grn_ii_cursor *c)
                                            size, grn_io_rdonly))) {
                   grn_p_decv(ctx, cp, size, c->rdv, c->ii->n_elements);
                   grn_io_win_unmap2(&iw);
+                  if (chunk_is_reused(ctx, c->ii, c,
+                                      c->cinfo[c->curr_chunk].segno, size)) {
+                    GRN_LOG(ctx, GRN_LOG_WARNING,
+                            "chunk(%d) is reused by another thread",
+                            c->cinfo[c->curr_chunk].segno);
+                    c->pc.rid = 0;
+                    break;
+                  }
                 } else {
                   c->pc.rid = 0;
                   break;




Groonga-commit メーリングリストの案内
Back to archive index