Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select による全文検索で brokend!! というエラーログが出る #548

Closed
s-yata opened this issue Jun 2, 2016 · 10 comments
Closed

Comments

@s-yata
Copy link
Contributor

s-yata commented Jun 2, 2016

概要

メーリングリストの groonga-dev において ピリオドを含む文字列の検索ができなくなった との報告がありました.これまでの調査により,ピリオドで常に起きるわけではなく,またピリオド以外でも起きることが確認されています.

症状

  • brokend!! というログが出力されることがあります.
  • select にすごく時間がかかることがあります.
    • 大量のログ出力で時間がかかるようです.
  • 稀にクラッシュします.

再現方法

現状で安定して再現できるのは load 中に select をおこなうケースです.ただし, load をしていない状況で起きたという報告もあります.

以下は,手元で再現できている方法の説明となっています.

# ddl.grn
table_create tbl TABLE_NO_KEY
column_create tbl col COLUMN_SCALAR LongText
table_create idx TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
column_create idx col COLUMN_INDEX|WITH_POSITION tbl col
# load.grn
load --table tbl
[
  ["col"],
  ["..."],
  ["..."],
  ...
# select.grn
select tbl --match_columns 'col' --query '価' --limit 0
select tbl --match_columns 'col' --query '鎖' --limit 0
select tbl --match_columns 'col' --query '夕' --limit 0
...

以下のように, load と同時に select を実行したときに brokend!! のログが出ました.このとき,ある程度のデータが投入されるまでは再現しませんでした.具体的にどのくらいかが境界になるのかについては不明ですが,問題が再現したときに使っていたデータは約 2GiB のテキストでした.

$ groonga -n --file ddl.grn db/db
$ groonga --log-path load.log --file load.grn db/db &
$ groonga --log-path select.log --file select.grn db/db > /dev/null
@s-yata
Copy link
Contributor Author

s-yata commented Jun 2, 2016

追記

Groonga 6.0.3 だけでなく Groonga 6.0.2 で再現することを確認しました.
ほかのバージョンについては未確認です.

kou added a commit that referenced this issue Jun 2, 2016
GitHub: #548

[groonga-dev,04028]

We should not use "jump" value for deleted record.

It may fix the reported problem with this change.

Reported by Atsushi Shinoda. Thanks!!!
@s-yata
Copy link
Contributor Author

s-yata commented Jun 3, 2016

設定を単純化していった結果,以下の単純なスクリプトをしばらく同時に動かすことでクラッシュしていました.
現在は 1a81814 によりクラッシュしなくなっています.

select.sh 側のログには以下のようなメッセージが出ていましたが,最新版では invalid ii_cursor c が出なくなっています. brokend!! とは異なるエラーですが,原因は同じだったようです.

2016-06-02 15:42:09.067468|w| chunk(143360) is reused by another thread
2016-06-02 15:42:09.067484|e| invalid ii_cursor c
2016-06-02 15:42:09.293228|w| chunk(137216) is reused by another thread
2016-06-02 15:42:09.338549|w| chunk(143360) is reused by another thread
2016-06-02 15:42:09.338564|e| invalid ii_cursor c
2016-06-02 15:42:09.622468|w| chunk(143360) is reused by another thread

@kou
Copy link
Member

kou commented Jun 7, 2016

@kou kou closed this as completed Jun 7, 2016
@kou
Copy link
Member

kou commented Jun 9, 2016

クラッシュする問題はまだ残っている。これは6.0.3より前のバージョンでも発生するし、まだ解決していない。ただし、これはもともと報告があった現象とは別の話。なので別issueにした方がよい気がする。

gdb上でselectを動かしてデバッグできるようにしたバージョン↓

select.rb.txt

@kou
Copy link
Member

kou commented Jun 9, 2016

バックトレース。

backtrace.txt

@kou
Copy link
Member

kou commented Jun 9, 2016

落ちているのはここ。

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77c2642 in grn_ii_cursor_next_pos (ctx=0x7fffffffe070, c=0xc0cd00)
    at ii.c:4678
4678                c->pc.pos += *c->cpp++;

@kou
Copy link
Member

kou commented Jun 9, 2016

c->cppがおかしくなっていて、*するとクラッシュ。

@s-yata
Copy link
Contributor Author

s-yata commented Jun 9, 2016

同じところでクラッシュすることを確認しました.
念のために,手元で取得したバックトレースを貼り付けておきます.
backtrace-s-yata.txt

@kou
Copy link
Member

kou commented Jun 13, 2016

15b9286 の頃は発生していなかったようです。
(手元で再現チェックをしても再現しない。たまたまクラッシュしていないだけなのか、問題がなかったのかはわからないが、発生していなかった可能性が高井。)

@kou
Copy link
Member

kou commented Jun 13, 2016

31fdc06 で直った気がします。
本当に直っているか確認するためにテストしています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants