[groonga-dev,02945] Re: delete後にselectするとmysqlが再起動する

Back to archive index

saki kashi saki.****@gmail*****
2014年 11月 11日 (火) 10:38:24 JST


須藤さん

こんにちは、kashiharaです。早速ご返信いただきありがとうございます。

検証環境では、同じデータに対して実行すると、必ず再現する状態になっています。
データに関してはそのままお渡しするのが難しいため、加工したデータでも再現されるのかどうか、こちらで確認してみますね。

  mmap Cannot allocate memoryエラーを回避するには
こちら確認させていただきましたが、
今回対象のDBサイズは2.1Gでvm.max_map_count は既に65530でしたので、
不足しているということはないように感じます。

groonga.logの記載した以前のログです。大量に出ているので一部分を切り取っております。
もしこれでも不足しているようでしたらお知らせください。

2014-11-10 16:27:20.022243|A|7afff700|mmap(20480,-1,0)=Cannot allocate
memory <18656522240>
2014-11-10 16:27:20.024866|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0f31153]
2014-11-10
16:27:20.024881|A|7afff700|/usr/lib64/libgroonga.so.0(grn_io_anon_map+0x10)
[0x39e0f31230]
2014-11-10 16:27:20.024887|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0e20904]
2014-11-10
16:27:20.024891|A|7afff700|/usr/lib64/libgroonga.so.0(grn_ctx_use+0x10d)
[0x39e0e20e0d]
2014-11-10
16:27:20.024895|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroongaC1EP10handlertonP11TABLE_SHARE+0x425)
[0x7f92f805f3c5]
2014-11-10
16:27:20.024899|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(+0x1ecba)
[0x7f92f805fcba]
2014-11-10
16:27:20.024904|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z15get_new_handlerP11TABLE_SHAREP11st_mem_rootP10handlerton+0x53)
[0x58e993]
2014-11-10
16:27:20.024908|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z14open_table_defP3THDP11TABLE_SHAREj+0x167c)
[0x7871dc]
2014-11-10
16:27:20.024912|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z15get_table_shareP3THDP10TABLE_LISTPKcjjPij+0x189)
[0x69e839]
2014-11-10
16:27:20.024916|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x6a0e0c]
2014-11-10
16:27:20.024920|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x846)
[0x6a72d6]
2014-11-10
16:27:20.024924|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0xbdc)
[0x6aa82c]
2014-11-10
16:27:20.024928|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x57)
[0x6aa9c7]
2014-11-10
16:27:20.024932|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x6ec04b]
2014-11-10
16:27:20.024936|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3575)
[0x6f13c5]
2014-11-10
16:27:20.024941|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x318)
[0x6f4dc8]
2014-11-10 16:27:20.025597|A|7afff700|mmap(20480,-1,0)=Cannot allocate
memory <18656522240>
2014-11-10 16:27:20.028139|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0f31153]
2014-11-10
16:27:20.028166|A|7afff700|/usr/lib64/libgroonga.so.0(grn_io_anon_map+0x10)
[0x39e0f31230]
2014-11-10 16:27:20.028172|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0e20904]
2014-11-10
16:27:20.028177|A|7afff700|/usr/lib64/libgroonga.so.0(grn_ctx_use+0x10d)
[0x39e0e20e0d]
2014-11-10
16:27:20.028181|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroongaC1EP10handlertonP11TABLE_SHARE+0x425)
[0x7f92f805f3c5]
2014-11-10
16:27:20.028185|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(+0x1ecba)
[0x7f92f805fcba]
2014-11-10
16:27:20.028190|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z15get_new_handlerP11TABLE_SHAREP11st_mem_rootP10handlerton+0x53)
[0x58e993]
2014-11-10
16:27:20.028194|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x111)
[0x781d11]
2014-11-10
16:27:20.028198|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x9d0)
[0x6a7460]
2014-11-10
16:27:20.028202|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0xbdc)
[0x6aa82c]
2014-11-10
16:27:20.028206|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x57)
[0x6aa9c7]
2014-11-10
16:27:20.028210|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x6ec04b]
2014-11-10
16:27:20.028215|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3575)
[0x6f13c5]
2014-11-10
16:27:20.028219|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x318)
[0x6f4dc8]
2014-11-10
16:27:20.028230|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xbcb)
[0x6f619b]
2014-11-10
16:27:20.028235|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10do_commandP3THD+0xd7)
[0x6f7f97]
2014-11-10 16:27:20.028278|A|7afff700|mmap(20480,-1,0)=Cannot allocate
memory <18656522240>
2014-11-10 16:27:20.030555|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0f31153]
2014-11-10
16:27:20.030566|A|7afff700|/usr/lib64/libgroonga.so.0(grn_io_anon_map+0x10)
[0x39e0f31230]
2014-11-10 16:27:20.030571|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0e20904]
2014-11-10
16:27:20.030575|A|7afff700|/usr/lib64/libgroonga.so.0(grn_ctx_use+0x10d)
[0x39e0e20e0d]
2014-11-10
16:27:20.030579|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga20ensure_database_openEPKc+0x139)
[0x7f92f806d1b9]
2014-11-10
16:27:20.030583|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga12storage_openEPKcij+0x1b)
[0x7f92f8071a2b]
2014-11-10
16:27:20.030588|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga4openEPKcij+0x129)
[0x7f92f8071bd9]
2014-11-10
16:27:20.030592|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_ZN7handler7ha_openEP5TABLEPKcii+0x3e)
[0x58c6be]
2014-11-10
16:27:20.030596|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x60b)
[0x78220b]
2014-11-10
16:27:20.030600|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x9d0)
[0x6a7460]
2014-11-10
16:27:20.030604|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0xbdc)
[0x6aa82c]
2014-11-10
16:27:20.030608|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x57)
[0x6aa9c7]
2014-11-10
16:27:20.030613|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x6ec04b]
2014-11-10
16:27:20.030617|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3575)
[0x6f13c5]
2014-11-10
16:27:20.030621|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x318)
[0x6f4dc8]
2014-11-10
16:27:20.030625|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xbcb)
[0x6f619b]
2014-11-10 16:27:20.100671|e|7afff700|db not initialized
2014-11-10
16:27:20.103204|e|7afff700|/usr/lib64/libgroonga.so.0(grn_plugin_register_by_path+0x15a)
[0x39e0f9498a]
2014-11-10
16:27:20.103215|e|7afff700|/usr/lib64/libgroonga.so.0(grn_plugin_register+0x4f)
[0x39e0f94c2f]
2014-11-10
16:27:20.103220|e|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga27ensure_normalizers_registerEv+0x5b)
[0x7f92f806d06b]
2014-11-10
16:27:20.103225|e|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga20ensure_database_openEPKc+0x141)
[0x7f92f806d1c1]
2014-11-10
16:27:20.103229|e|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga12storage_openEPKcij+0x1b)
[0x7f92f8071a2b]
2014-11-10
16:27:20.103233|e|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga4openEPKcij+0x129)
[0x7f92f8071bd9]
2014-11-10
16:27:20.103237|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_ZN7handler7ha_openEP5TABLEPKcii+0x3e)
[0x58c6be]
2014-11-10
16:27:20.103241|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x60b)
[0x78220b]
2014-11-10
16:27:20.103246|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x9d0)
[0x6a7460]
2014-11-10
16:27:20.103250|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0xbdc)
[0x6aa82c]
2014-11-10
16:27:20.103254|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x57)
[0x6aa9c7]
2014-11-10
16:27:20.103258|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x6ec04b]
2014-11-10
16:27:20.103262|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3575)
[0x6f13c5]
2014-11-10
16:27:20.103272|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x318)
[0x6f4dc8]
2014-11-10
16:27:20.103277|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xbcb)
[0x6f619b]
2014-11-10
16:27:20.103282|e|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z10do_commandP3THD+0xd7)
[0x6f7f97]
2014-11-10 16:27:41.494837|A|7afff700|mmap(4194304,-1,0)=Cannot allocate
memory <18656522240>
2014-11-10 16:27:41.509704|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0f31153]
2014-11-10
16:27:41.509721|A|7afff700|/usr/lib64/libgroonga.so.0(grn_io_seg_map_+0x18e)
[0x39e0f3539e]
2014-11-10
16:27:41.509726|A|7afff700|/usr/lib64/libgroonga.so.0(grn_io_segment_alloc+0x6c0)
[0x39e0f37470]
2014-11-10
16:27:41.509731|A|7afff700|/usr/lib64/libgroonga.so.0(grn_hash_add+0x557)
[0x39e0f06807]
2014-11-10 16:27:41.509735|A|7afff700|/usr/lib64/libgroonga.so.0()
[0x39e0e60676]
2014-11-10
16:27:41.509739|A|7afff700|/usr/lib64/libgroonga.so.0(grn_expr_get_or_add_var+0x44)
[0x39e0e62274]
2014-11-10
16:27:41.509744|A|7afff700|/usr/lib64/libgroonga.so.0(grn_expr_add_var+0x50)
[0x39e0e677b0]
2014-11-10
16:27:41.509748|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga26generic_ft_init_ext_selectEjjP6String+0x20d)
[0x7f92f806b16d]
2014-11-10
16:27:41.509752|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga19generic_ft_init_extEjjP6String+0x96)
[0x7f92f806b456]
2014-11-10
16:27:41.509756|A|7afff700|/MYSQL/mroonga101/product/lib/plugin/ha_mroonga.so(_ZN10ha_mroonga19storage_ft_init_extEjjP6String+0x9)
[0x7f92f806b619]
2014-11-10
16:27:41.509761|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_ZN15Item_func_match11init_searchEb+0x160)
[0x5fa260]
2014-11-10
16:27:41.509765|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z12init_ftfuncsP3THDP13st_select_lexb+0x5e)
[0x69f0ae]
2014-11-10
16:27:41.509769|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_ZN4JOIN8optimizeEv+0x3d16)
[0x86bdb6]
2014-11-10
16:27:41.509773|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld() [0x710fa4]
2014-11-10
16:27:41.509777|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xbc)
[0x71132c]
2014-11-10
16:27:41.509781|A|7afff700|/MYSQL/mroonga101/product/bin/mysqld(_Z13handle_selectP3THDP13select_resultm+0x175)
[0x711535]
2014-11-10 16:27:41.509788|C|7afff700|mmap failed!!!! in
GRN_IO_SEG_REF(0x7f9210010ee0, 0): Cannot allocate memory
2014-11-10 16:27:41.509850|C|7afff700|mmap failed!!!! in
GRN_IO_SEG_REF(0x7f9210010ee0, 0): Cannot allocate memory
2014-11-10 16:27:41.509897|C|7afff700|mmap failed!!!! in
GRN_IO_SEG_REF(0x7f9210010ee0, 0): Cannot allocate memory
2014-11-10 16:27:41.509912|C|7afff700|mmap failed!!!! in
GRN_IO_SEG_REF(0x7f9210010ee0, 0): Cannot allocate memory



2014年11月10日 17:55 Kouhei Sutou <kou****@clear*****>:

> 須藤です。
>
> In <CAA3xOTWV9QxsKNQa8F+MfWsGuOn-GU2E8TQ2C4kkJ=JA-gU****@mail*****>
>   "[groonga-dev,02942] delete後にselectするとmysqlが再起動する" on Mon, 10 Nov 2014
> 16:55:22 +0900,
>   saki kashi <saki.****@gmail*****> wrote:
>
> > 以前からラッパーモードを利用させていただいており、
> > 新規サービス導入にあたってストレージモードを利用させていただいております。
>
> ありがとうございます!
>
> > そこで、気になる点が出てきたのですが、
> > Mroongaエンジンのテーブルでdeleteを実行し、その後selectすると
> > mysqlが再起動してしまいます。
>
> これは、バグっぽい気がします。。。
>
> kashiharaさんの環境では同じデータに対して同じdeleteとselect
> を実行すると必ず再現する状態でしょうか?もし、再現するデータ
> があるのであれば、調査したいので、可能ならデータを提供しても
> らえないでしょうか?
>
> >>delete from product_search  where seller_id not in (select user_id from
> > user_info where id in (
> >
> '355272339','355282327','355283438','355281468','355282478','355283491','355282506','355282528','355281589','355283592','355281614','355284640','355284754','355284675','355284699','355283736'));
> > Query OK, 1857568 rows affected (13 min 25.10 sec)
>
> 180万件を一気に削除というのはたしかにたくさん消していますねぇ。
>
> > groonga.logには削除中にCannot allocate memoryのメッセージが出ています。
> >
> > .027012|C|1577f700|mmap failed!!! in GRN_IO_SEG_REF(0x7f925896ce20,
> 78970,
> > 1): Cannot allocate memory
>
> その少し前のログも見せてもらえないでしょうか?
>
>   mmap(...)
>
> みたいなログもでていると思うのですが。。。
>
> > 大量のデータを削除した場合、Cannot allocate memoryになり、落ちてしまうのでしょうか?
>
> いやぁ、そういうわけではないんですよ。
>
> 念のため、↓を試してみてもらえませんか?
>
>   mmap Cannot allocate memoryエラーを回避するには
>
> http://groonga.org/ja/docs/troubleshooting/mmap_cannot_allocate_memory.html
>
> > また、再起動後もテーブル自体が壊れる場合もあれば壊れない場合もあります。
>
> 今回のDELETE中とか更新中に落ちたときは壊れている可能性が高い
> ので、可能ならバックアップからテーブルを作りなおした方が安全
> です。。。
>
> SELECT中とか参照しているだけなら大丈夫なんですけど。。。
>
>
> --
> 須藤 功平 <kou****@clear*****>
> 株式会社クリアコード <http://www.clear-code.com/>
>
> Groongaベースの全文検索システムを総合サポート:
>   http://groonga.org/ja/support/
> パッチ採用 - プログラミングが楽しい人向けの採用プロセス:
>   http://www.clear-code.com/recruitment/
> 名著『リーダブルコード』を解説者と一緒に読み解こう:
>   http://schoo.jp/class/1502
>
> _______________________________________________
> groonga-dev mailing list
> groon****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
>



groonga-dev メーリングリストの案内
Back to archive index