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

mroonga_lock_timeout doesn't refrect when it's specified at mysqld starts up #7

Merged
merged 1 commit into from Apr 22, 2014

Conversation

Projects
None yet
2 participants
@yoku0825
Contributor

yoku0825 commented Apr 21, 2014

Detail:
MySQL system variable "mroonga_lock_timeout" added in Mroonga 3.12 doesn't refrect lock timeout value at Groonga's layer lock, when it is setted at mysqld's startup, by my.cnf and by command-line argument.
"SET GLOBAL mroonga_lock_timeout" works well, but both of starting "bin/mysqld_safe --mroonga-lock-timeout=5" and writing "mroonga-lock-timeout= 5" into my.cnf doesn't work as expected.
Because of that, grn_set_lock_timeout is only called when "SET GLOBAL mroonga_lock_timeout"'s execution, mrn_init should call grn_set_lock_timeout too.

How to repeat:
--write mroonga-lock-timeout=5 into my.cnf and start mysqld.
--at connection 1.
mysql> SELECT @@global.mroonga_lock_timeout; -- This prints "5" as expected.
mysql> CREATE DATABASE mroonga;
mysql> CREATE TABLE mroonga.t1 (num int) Engine= Mroonga;
--at connection 2.
shell> ruby -e require "groonga"; Groonga::Database.open("/path/to/mroonga.mrn"); Groonga["t1"].lock; exit' # force locking table.
--at connection 1.
mysql> INSERT INTO mroonga.t1 VALUES (1); -- This doesn't return over "5"ms as expected.

(gdb) bt
#0 0x0000003eb480ed2d in nanosleep () from /lib64/libpthread.so.0
#1 0x00007fb46d4bb1d9 in grn_nanosleep (nanoseconds=) at ctx.c:82
#2 0x00007fb46d5c30f2 in grn_io_lock (ctx=0x7fb41c03f518, io=0x7fb41c36be30, timeout=10000000) at io.c:1320

..

grn_io_lock receives timeout value 10000000, this isn't the value specified in my.cnf.

Suggested fix:
Add grn_set_lock_timeout() in mrn_init() like attached patch.

kou added a commit that referenced this pull request Apr 22, 2014

Merge pull request #7 from yoku0825/fix_for_mroonga_lock_timeout_init…
…ialization

mroonga_lock_timeout doesn't refrect when it's specified at mysqld starts up

Patch by yoku0825. Thanks!!!

@kou kou merged commit 3584750 into mroonga:master Apr 22, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details
@kou

This comment has been minimized.

Show comment
Hide comment
@kou

kou Apr 22, 2014

Member

Thanks!
I've merged it!

Member

kou commented Apr 22, 2014

Thanks!
I've merged it!

@yoku0825

This comment has been minimized.

Show comment
Hide comment
@yoku0825

yoku0825 Apr 28, 2014

Contributor

Thank you for your acceptance.

Would you record this patch author is "GMO Media, Inc." to next relnote?
The company name in Japanese, "GMOメディア株式会社", which I'm working for.

Regards,

Contributor

yoku0825 commented Apr 28, 2014

Thank you for your acceptance.

Would you record this patch author is "GMO Media, Inc." to next relnote?
The company name in Japanese, "GMOメディア株式会社", which I'm working for.

Regards,

@kou

This comment has been minimized.

Show comment
Hide comment
@kou

kou Apr 28, 2014

Member

OK!

Member

kou commented Apr 28, 2014

OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment