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

mysql cannot working with fs=ramfs #975

Closed
yuwang888 opened this issue May 22, 2018 · 3 comments
Closed

mysql cannot working with fs=ramfs #975

yuwang888 opened this issue May 22, 2018 · 3 comments

Comments

@yuwang888
Copy link

i use fs=ramfs to build the mysql
#./scripts/build image=mysql fs=ramfs
#./scripts/run.py -nv
but mysql can not work well
#mysql -h 192.168.122.76 -u root
ERROR 1130 (HY000): Host '192.168.122.1' is not allowed to connect to this MySQL server

the log i found
Warning: World-writable config file '/etc/my.cnf' is ignored
but ls -l /etc/my.cnf is 644
"
Warning: World-writable config file '/etc/my.cnf' is ignored
2018-05-22 12:45:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-05-22 12:45:11 0 [Note] Plugin 'FEDERATED' is disabled.
2018-05-22 12:45:11 0 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-05-22 12:45:11 0 [Note] InnoDB: The InnoDB memory heap is disabled
2018-05-22 12:45:11 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-05-22 12:45:11 0 [Note] InnoDB: Memory barrier is not used
2018-05-22 12:45:11 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-05-22 12:45:11 0 [Note] InnoDB: Using CPU crc32 instructions
2018-05-22 12:45:11 0 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-05-22 12:45:11 0 [Note] InnoDB: Completed initialization of buffer pool
WARNING: fcntl(F_SETLK) stubbed
2018-05-22 12:45:11 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-05-22 12:45:11 0 [Note] InnoDB: 128 rollback segment(s) are active.
2018-05-22 12:45:11 0 [Note] InnoDB: 5.6.21 started; log sequence number 1625997
2018-05-22 12:45:11 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: f74e65b2-5dbd-11e8-80cd-525400123456.
2018-05-22 12:45:11 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-05-22 12:45:11 0 [Note] IPv6 is not available.
2018-05-22 12:45:11 0 [Note] - '0.0.0.0' resolves to '0.0.0.0';
2018-05-22 12:45:11 0 [Note] Server socket created on IP: '0.0.0.0'.
2018-05-22 12:45:11 0 [Note] Event Scheduler: Loaded 0 events
2018-05-22 12:45:11 0 [Note] /usr/bin/mysqld: ready for connections.
Version: '5.6.21' socket: '' port: 3306 Source distribution
2018-05-22 12:45:57 0 [Warning] IP address '192.168.122.1' could not be resolved: Name does not resolve
"

@yuwang888
Copy link
Author

i found the root cause, is that when use ramfs , all the file permission is change to "777", it works when i modify the mysql code to not adjust the permission,
but when use sysbench to test, crash
"
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=16384
read_buffer_size=262144
max_used_connections=150
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 50401 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0xffff80013dc2c040
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 20000aaf2ef0 thread_stack 0x20000
my_print_stacktrace+53 [0x100000c866e4]
handle_fatal_signal+1011 [0x1000009a5f7f]
call_signal_handler+540 [0x38524c]
???+3763342 [0x396c8e]
void ut_list_remove<ut_list_base<mem_block_info_t>, mem_block_info_t>(ut_list_base<mem_block_info_t>&, mem_block_info_t&, unsigned long)+144 [0x100000d2b826]
???+13809168 [0x100000d2b610]
???+14090188 [0x100000d6ffcc]
???+14090475 [0x100000d700eb]
???+14109035 [0x100000d7496b]
???+14120075 [0x100000d7748b]
???+13603527 [0x100000cf92c7]
handler::ha_inplace_alter_table(TABLE*, Alter_inplace_info*)+53 [0x100000a9e1d1]
???+11107476 [0x100000a97c94]
mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool)+4587 [0x100000a9b735]
mysql_execute_command(THD*)+6394 [0x100000a37be4]
mysql_parse(THD*, char*, unsigned int, Parser_state*)+996 [0x100000a3ed47]
dispatch_command(enum_server_command, THD*, char*, unsigned int)+2889 [0x100000a343a4]
do_command(THD*)+464 [0x100000a336e8]
do_handle_one_connection(THD*)+438 [0x100000a024c3]
handle_one_connection+51 [0x100000a01fd9]
pfs_spawn_thread+345 [0x100000cc66fe]
???+4531094 [0x452396]
thread_main_c+40 [0x3f8238]
call_signal_handler_thunk+0 [0x396c86]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (ffff80013d375050): /usr/bin/mysqld: failed looking up symbol sbrk

[backtrace]
0x000000000034815d <elf::object::symbol(unsigned int)+205>
0x00000000003484de <elf::object::resolve_pltgot(unsigned int)+126>

"

@nyh
Copy link
Contributor

nyh commented May 23, 2018

Your second report is a different issue, and you please try to reproduce it without any "fs=..." parameter, and report it as a separate issue? It will be hard to solve this without debugging mysql and trying to understand if mysql itself has a bug, or somehow got misled by OSv (note that the crash is in mysql code, not in OSv code). We did test mysql on OSv in the past and didn't see these errors, but since then all of mysql, OSv and the compilers, have changed, so there may have been some regression.

@wkozaczuk
Copy link
Collaborator

@yuwang888 I think this issue can be closed. We have fixed number of ramfs bugs that may have caused this crash:

Also I have added apps/mysql/test.sh script that uses sysbench to test it. Here is the sample output from the test which seems to be passing reliably:

Running OSv on qemu with parameters: [-s -e --power-off-on-abort /usr/bin/mysqld --datadir=/usr/data --user=root --innodb-use-native-aio=OFF --explicit_defaults_for_timestamp --innodb-strict-mode=OFF --pass-args=-monitor unix:qemu-monitor,server,nowait --block-device-cache unsafe]
OSv v0.54.0-43-ga3d5acf0
Solaris: NOTICE: Cannot find the pool label for '/dev/vblk0.1'
eth0: 192.168.122.76
Booted up in 522.99 ms
Cmdline: /usr/bin/mysqld --datadir=/usr/data --user=root --innodb-use-native-aio=OFF --explicit_defaults_for_timestamp --innodb-strict-mode=OFF
Warning: World-writable config file '/etc/my.cnf' is ignored
2019-11-27 21:09:58 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2019-11-27 21:09:58 0 [Note] /usr/bin/mysqld (mysqld 5.6.45) starting as process 0 ...
2019-11-27 21:09:58 0 [Note] Plugin 'FEDERATED' is disabled.
2019-11-27 21:09:58 0 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-11-27 21:09:58 0 [Note] InnoDB: The InnoDB memory heap is disabled
2019-11-27 21:09:58 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-11-27 21:09:58 0 [Note] InnoDB: Memory barrier is not used
2019-11-27 21:09:58 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-11-27 21:09:58 0 [Note] InnoDB: Using CPU crc32 instructions
2019-11-27 21:09:58 0 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-11-27 21:09:58 0 [Note] InnoDB: Completed initialization of buffer pool
WARNING: fcntl(F_SETLK) stubbed
2019-11-27 21:09:58 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-11-27 21:09:58 0 [Note] InnoDB: 128 rollback segment(s) are active.
2019-11-27 21:09:58 0 [Note] InnoDB: 5.6.45 started; log sequence number 1625997
2019-11-27 21:09:58 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 44a11878-115a-11ea-9958-525400123456.
2019-11-27 21:09:58 0 [Note] Server hostname (bind-address): '*'; port: 3306
2019-11-27 21:09:58 0 [Note] IPv6 is not available.
2019-11-27 21:09:58 0 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2019-11-27 21:09:58 0 [Note] Server socket created on IP: '0.0.0.0'.
2019-11-27 21:09:58 0 [Warning] Insecure configuration for --pid-file: Location '/usr/data' in the path is accessible to all OS users. Consider choosing a different directory.
2019-11-27 21:09:58 0 [Note] Event Scheduler: Loaded 0 events
2019-11-27 21:09:58 0 [Note] /usr/bin/mysqld: ready for connections.
-----------------------------------
Started mysql test ...
Version: '5.6.45'  socket: ''  port: 3306  Source distribution
2019-11-27 21:09:58 0 [Warning] Hostname 'wkoMacBookPro' does not resolve to '192.168.122.1'.
2019-11-27 21:09:58 0 [Note] Hostname 'wkoMacBookPro' has the following IP addresses:
2019-11-27 21:09:58 0 [Note]  - 127.0.1.1
sysbench 1.0.17 (using system LuaJIT 2.1.0-beta3)

Creating table 'sbtest1'...
Inserting 100000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 100000 records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 100000 records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
sysbench 1.0.17 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 12
Report intermediate results every 10 second(s)
Initializing random number generator from current time


Initializing worker threads...

Threads started!

[ 10s ] thds: 12 tps: 465.22 qps: 9323.26 (r/w/o: 6528.75/1862.87/931.64) lat (ms,95%): 41.85 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 12 tps: 456.00 qps: 9114.84 (r/w/o: 6380.83/1822.01/912.00) lat (ms,95%): 33.12 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 12 tps: 455.30 qps: 9103.85 (r/w/o: 6371.74/1821.61/910.51) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 12 tps: 450.20 qps: 9004.46 (r/w/o: 6302.47/1801.49/900.50) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 12 tps: 434.87 qps: 8698.50 (r/w/o: 6090.38/1738.38/869.74) lat (ms,95%): 34.95 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 12 tps: 381.51 qps: 7632.03 (r/w/o: 5341.96/1527.05/763.02) lat (ms,95%): 42.61 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            370216
        write:                           105776
        other:                           52888
        total:                           528880
    transactions:                        26444  (440.60 per sec.)
    queries:                             528880 (8812.04 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          60.0161s
    total number of events:              26444

Latency (ms):
         min:                                    3.31
         avg:                                   27.23
         max:                                  121.57
         95th percentile:                       36.24
         sum:                               720040.24

Threads fairness:
    events (avg/stddev):           2203.6667/12.59
    execution time (avg/stddev):   60.0034/0.01


-----------------------------------
SUCCESS

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

3 participants