Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1583

Pathologically splitting a page

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.5.1
    • Affects Version/s: None
    • Component/s: None

      There is a MongoDB test case that splits a page pathologically.

      I added some debug print statements to

      Unable to find source-code formatter for language: __split_multi_inmem```. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       as follows:
      
      

      — wiredtiger/src/btree/bt_split.c
      +++ wiredtiger/src/btree/bt_split.c
      @@ -734,7 +734,14 @@ __split_multi_inmem(

      • In some cases involving forced eviction during truncates, a reader
      • ends up looking at an evicted page. This is a temporary workaround.
        */
        +#if 0
        page->modify->inmem_split_txn = __wt_txn_new_id(session);
        +#endif
        + fprintf(stderr,
        + "Split new page. From %p (%"PRIu32"), to %p (%" PRIu32 ")."
        + " %"PRIu64" to %"PRIu64"\n",
        + orig, orig->u.row.entries, page, page->u.row.entries,
        + orig->memory_footprint, page->memory_footprint);

      err: /_ Free any resources that may have been cached in the cursor. _/
      WT_TRET(__wt_btcur_close(&cbt));

      
      In the workload this generates the following output:
      
      

      m31001| Split new page. From 0x607000057120 (0), to 0x61700012db00 (86). 184565855 to 4197709
      m31001| Split new page. From 0x607000045a00 (0), to 0x60b00004a650 (4). 12585842 to 8390882
      m31001| Split new page. From 0x60b00004a650 (4), to 0x60b00004a5a0 (4). 10488402 to 10488426
      m31001| Split new page. From 0x60b00004a5a0 (4), to 0x60b00004a4f0 (4). 10488426 to 10488450
      m31001| Split new page. From 0x60b00004a4f0 (4), to 0x60b00004a440 (4). 10488450 to 10488434
      m31001| Split new page. From 0x60b00004a440 (4), to 0x60b00004a390 (4). 10488434 to 10488402
      m31001| Split new page. From 0x60b00004a390 (4), to 0x60b00004a2e0 (4). 10488402 to 10488426
      m31001| Split new page. From 0x60b00004a2e0 (4), to 0x60b00004a230 (4). 10488426 to 10488442
      m31001| Split new page. From 0x60b00004a230 (4), to 0x60b00004a180 (4). 10488442 to 10488434
      m31001| Split new page. From 0x60b00004a180 (4), to 0x60b00004a0d0 (4). 10488434 to 10488402
      m31001| Split new page. From 0x60b00004a0d0 (4), to 0x60b00004a020 (4). 10488402 to 10488394
      m31001| Split new page. From 0x60b00004a020 (4), to 0x60b000049f70 (4). 10488394 to 10488418
      m31001| Split new page. From 0x60b000049f70 (4), to 0x60b000049ec0 (4). 11537174 to 11537158
      m31001| Split new page. From 0x60b000049ec0 (4), to 0x60b000049e10 (4). 11537158 to 11537198
      m31001| Split new page. From 0x60b000049e10 (4), to 0x60b000049d60 (4). 11537198 to 11537198
      m31001| Split new page. From 0x60b000049d60 (4), to 0x60b000049cb0 (4). 11537198 to 11537158
      m31001| Split new page. From 0x60b000049cb0 (4), to 0x60b000049c00 (4). 11537158 to 11537182
      m31001| Split new page. From 0x60b000049c00 (4), to 0x60b000049b50 (4). 11537182 to 11537158
      m31001| Split new page. From 0x60b000049b50 (4), to 0x60b000049aa0 (4). 11537158 to 11537166
      m31001| Split new page. From 0x60b000049aa0 (4), to 0x60b0000499f0 (4). 11537166 to 11537198
      m31001| Split new page. From 0x60b0000499f0 (4), to 0x60b000049940 (4). 11537198 to 11537150
      m31001| Split new page. From 0x60b000049940 (4), to 0x60b000049890 (4). 11537150 to 11537166
      m31001| Split new page. From 0x60b000049890 (4), to 0x60b0000497e0 (4). 12585922 to 12585930
      m31001| Split new page. From 0x60b0000497e0 (4), to 0x60b000049730 (4). 12585930 to 12585930
      m31001| Split new page. From 0x60b000049730 (4), to 0x60b000049680 (4). 12585930 to 12585922
      m31001| Split new page. From 0x60b000049680 (4), to 0x60b0000495d0 (4). 12585922 to 12585938
      m31001| Split new page. From 0x60b0000495d0 (4), to 0x60b000049520 (4). 12585938 to 12585962
      m31001| Split new page. From 0x60b000049520 (4), to 0x60b000049470 (4). 12585962 to 12585938
      m31001| Split new page. From 0x60b000049470 (4), to 0x60b0000493c0 (4). 12585938 to 12585930
      m31001| Split new page. From 0x60b0000493c0 (4), to 0x60b000049310 (4). 12585930 to 12585930
      m31001| Split new page. From 0x60b000049310 (4), to 0x60b000049260 (4). 12585930 to 12585962
      m31001| Split new page. From 0x60b000049260 (4), to 0x60b0000491b0 (4). 12585962 to 12585946
      m31001| Split new page. From 0x60b0000491b0 (4), to 0x60b000049100 (4). 13634702 to 13634686
      m31001| Split new page. From 0x60b000049100 (4), to 0x60b000049050 (4). 13634686 to 13634686
      m31001| Split new page. From 0x60b000049050 (4), to 0x60b000048fa0 (4). 13634686 to 13634678
      m31001| Split new page. From 0x60b000048fa0 (4), to 0x60b000048ef0 (4). 13634678 to 13634686
      m31001| Split new page. From 0x60b000048ef0 (4), to 0x60b000048e40 (4). 13634686 to 13634726
      m31001| Split new page. From 0x60b000048e40 (4), to 0x60b000048d90 (4). 13634726 to 13634702
      m31001| Split new page. From 0x60b000048d90 (4), to 0x60b000048ce0 (4). 13634702 to 13634710
      m31001| Split new page. From 0x60b000048ce0 (4), to 0x60b000048c30 (4). 13634710 to 13634694
      m31001| Split new page. From 0x60b000048c30 (4), to 0x60b000048b80 (4). 13634694 to 13634710
      m31001| Split new page. From 0x60b000048b80 (4), to 0x60b000048ad0 (4). 13634710 to 13634710
      m31001| Split new page. From 0x60b000048ad0 (4), to 0x60b000048a20 (4). 14683474 to 14683458
      m31001| Split new page. From 0x60b000048a20 (4), to 0x60b000048970 (4). 14683458 to 14683490
      m31001| Split new page. From 0x60b000048970 (4), to 0x60b0000488c0 (4). 14683490 to 14683482
      m31001| Split new page. From 0x60b0000488c0 (4), to 0x60b000048810 (4). 14683482 to 14683450
      m31001| Split new page. From 0x60b000048810 (4), to 0x60b000048760 (4). 14683450 to 14683426
      m31001| Split new page. From 0x60b000048760 (4), to 0x60b0000486b0 (4). 14683426 to 14683450
      m31001| Split new page. From 0x60b0000486b0 (4), to 0x60b000048600 (4). 14683450 to 14683442
      m31001| Split new page. From 0x60b000048600 (4), to 0x60b000048550 (4). 14683442 to 14683466
      m31001| Split new page. From 0x60b000048550 (4), to 0x60b0000484a0 (4). 14683466 to 14683474
      m31001| Split new page. From 0x60b0000484a0 (4), to 0x60b0000483f0 (4). 14683474 to 14683434
      m31001| Split new page. From 0x60b0000483f0 (4), to 0x60b000048340 (4). 15732198 to 15732182
      m31001| Split new page. From 0x60b000048340 (4), to 0x60b000048290 (4). 15732182 to 15732214
      m31001| Split new page. From 0x60b000048290 (4), to 0x60b0000481e0 (4). 15732214 to 15732214
      m31001| Split new page. From 0x60b0000481e0 (4), to 0x60b000048130 (4). 15732214 to 15732214
      m31001| Split new page. From 0x60b000048130 (4), to 0x60b000048080 (4). 15732214 to 15732214

      <snip ~850 lines>
      m31001| Split new page. From 0x60b0000c3a70 (4), to 0x60b0000c39c0 (4). 101730558 to 101730446
      m31001| Split new page. From 0x60b0000c39c0 (4), to 0x60b0000c3910 (4). 101730446 to 101730374
      m31001| Split new page. From 0x60b0000c3910 (4), to 0x60b0000c3860 (4). 101730374 to 101730350
      m31001| Split new page. From 0x60b0000c3860 (4), to 0x60b0000c37b0 (4). 101730350 to 101730478
      m31001| Split new page. From 0x60b0000c37b0 (4), to 0x60b0000c3700 (4). 101730478 to 101730454
      m31001| Split new page. From 0x60b0000c3700 (4), to 0x60b0000c3650 (4). 101730454 to 101730390
      m31001| Split new page. From 0x60b0000c3650 (4), to 0x60b0000c35a0 (4). 101730390 to 101730454
      m31001| Split new page. From 0x60b0000c35a0 (4), to 0x60b0000c34f0 (4). 101730454 to 101730422
      m31001| Split new page. From 0x60b0000c34f0 (4), to 0x60b0000c3440 (4). 101730422 to 101730494
      m31001| Split new page. From 0x60b0000c3440 (4), to 0x60b0000c3390 (4). 101730494 to 101730414
      m31001| Split new page. From 0x60b0000c3390 (4), to 0x60b0000c32e0 (4). 101730414 to 101730390
      m31001| Split new page. From 0x60b0000c32e0 (4), to 0x60b0000c3230 (4). 101730390 to 101730350
      m31001| Split new page. From 0x60b0000c3230 (4), to 0x60b0000c3180 (4). 101730350 to 101730550
      m31001| Split new page. From 0x60b0000c3180 (4), to 0x60b0000c30d0 (4). 101730550 to 101730454
      m31001| Split new page. From 0x60b0000c30d0 (4), to 0x60b0000c3020 (4). 101730454 to 101730446
      m31001| Split new page. From 0x60b0000c3020 (4), to 0x60b0000c2f70 (4). 101730446 to 101730382
      m31001| Split new page. From 0x60b0000c2f70 (4), to 0x60b0000c2ec0 (4). 101730382 to 101730406
      m31001| Split new page. From 0x60b0000c2ec0 (4), to 0x60b0000c2e10 (4). 101730406 to 101730382
      m31001| Split new page. From 0x60b0000c2e10 (4), to 0x60b0000c2d60 (4). 101730382 to 101730382
      m31001| Split new page. From 0x60b0000c2d60 (4), to 0x60b0000c2cb0 (4). 101730382 to 101730422
      m31001| Split new page. From 0x60b0000c2cb0 (4), to 0x60b0000c2c00 (4). 101730422 to 101730494
      m31001| Split new page. From 0x60b0000c2c00 (4), to 0x60b0000c2b50 (4). 101730494 to 101730334

      
      The stack trace from the first split is:
      
      

      #0 __split_multi_inmem (session=<optimized out>, orig=<optimized out>, ref=<optimized out>, multi=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_split.c:740
      WT-1 0x00000000032bc0aa in __wt_split_rewrite (session=<optimized out>, ref=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_split.c:1452
      WT-2 0x0000000003362af6 in __evict_page_dirty_update (session=<optimized out>, ref=<optimized out>,
      exclusive=<optimized out>) at src/third_party/wiredtiger/src/evict/evict_page.c:213
      WT-3 __wt_evict (session=<optimized out>, ref=<optimized out>, exclusive=<optimized out>)
      at src/third_party/wiredtiger/src/evict/evict_page.c:109
      WT-4 0x0000000003360fcc in __wt_evict_page (session=<optimized out>, ref=<optimized out>, session=<optimized out>,
      ref=<optimized out>) at src/third_party/wiredtiger/src/evict/evict_lru.c:630
      WT-5 0x000000000329baf0 in __wt_page_release_busy (session=<optimized out>, ref=<optimized out>, flags=<optimized out>,
      session=<optimized out>, ref=<optimized out>, flags=<optimized out>)
      at src/third_party/wiredtiger/src/include/btree.i:916
      WT-6 __wt_page_in_func (session=<optimized out>, ref=<optimized out>, flags=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_page.c:134
      WT-7 0x00000000032de005 in __wt_page_swap_func (flags=<optimized out>, session=<optimized out>, held=<optimized out>,
      want=<optimized out>, flags=<optimized out>) at src/third_party/wiredtiger/src/include/btree.i:969
      WT-8 __wt_row_search (session=0x7fd24c8499c0, srch_key=<optimized out>, leaf=<optimized out>, cbt=0x6170000ad800,
      insert=1) at src/third_party/wiredtiger/src/btree/row_srch.c:296
      WT-9 0x0000000003285396 in __cursor_row_search (cbt=<optimized out>, insert=<optimized out>, session=<optimized out>,
      cbt=<optimized out>, insert=<optimized out>) at src/third_party/wiredtiger/src/btree/bt_cursor.c:239
      WT-10 __wt_btcur_insert (cbt=0x6170000ad800) at src/third_party/wiredtiger/src/btree/bt_cursor.c:484
      WT-11 0x000000000331ee57 in __curfile_insert (cursor=0x6170000ad800)
      at src/third_party/wiredtiger/src/cursor/cur_file.c:245
      WT-12 0x0000000001e8818c in mongo::WiredTigerRecordStore::insertRecord (this=<optimized out>, len=<optimized out>,
      txn=<optimized out>, data=<optimized out>, enforceQuota=<optimized out>)
      at src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp:507

      
      The stack trace from one of the other splits is:
      
      

      #0 __split_multi_inmem (session=<optimized out>, orig=<optimized out>, ref=<optimized out>, multi=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_split.c:740
      WT-1 0x00000000032bc0aa in __wt_split_rewrite (session=<optimized out>, ref=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_split.c:1452
      WT-2 0x0000000003362af6 in __evict_page_dirty_update (session=<optimized out>, ref=<optimized out>,
      exclusive=<optimized out>) at src/third_party/wiredtiger/src/evict/evict_page.c:213
      WT-3 __wt_evict (session=<optimized out>, ref=<optimized out>, exclusive=<optimized out>)
      at src/third_party/wiredtiger/src/evict/evict_page.c:109
      WT-4 0x0000000003360fcc in __wt_evict_page (session=<optimized out>, ref=<optimized out>, session=<optimized out>,
      ref=<optimized out>) at src/third_party/wiredtiger/src/evict/evict_lru.c:630
      WT-5 0x000000000329baf0 in __wt_page_release_busy (session=<optimized out>, ref=<optimized out>, flags=<optimized out>,
      session=<optimized out>, ref=<optimized out>, flags=<optimized out>)
      at src/third_party/wiredtiger/src/include/btree.i:916
      WT-6 __wt_page_in_func (session=<optimized out>, ref=<optimized out>, flags=<optimized out>)
      at src/third_party/wiredtiger/src/btree/bt_page.c:134
      WT-7 0x00000000032de005 in __wt_page_swap_func (flags=<optimized out>, session=<optimized out>, held=<optimized out>,
      want=<optimized out>, flags=<optimized out>) at src/third_party/wiredtiger/src/include/btree.i:969
      WT-8 __wt_row_search (session=0x7fd24c8499c0, srch_key=<optimized out>, leaf=<optimized out>, cbt=0x6170000ad800,
      insert=1) at src/third_party/wiredtiger/src/btree/row_srch.c:296
      WT-9 0x0000000003285396 in __cursor_row_search (cbt=<optimized out>, insert=<optimized out>, session=<optimized out>,
      cbt=<optimized out>, insert=<optimized out>) at src/third_party/wiredtiger/src/btree/bt_cursor.c:239
      WT-10 __wt_btcur_insert (cbt=0x6170000ad800) at src/third_party/wiredtiger/src/btree/bt_cursor.c:484
      WT-11 0x000000000331ee57 in __curfile_insert (cursor=0x6170000ad800)
      at src/third_party/wiredtiger/src/cursor/cur_file.c:245
      `

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: