-
Notifications
You must be signed in to change notification settings - Fork 312
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
Panic "index out of bounds" while inserting a lot of data #4696
Comments
Maybe related to the parser crate or mysql service crate we use. Could you also share your logs with us? It'd be helpful if you could change the log level to "debug", for example:
This only enables the debug log for the sqlparser crate. You can also use the
|
it seems we are having a illegal char from somewhere since this test also failed with same panic: #[test]
fn test_unicode() {
for idx in 0..u32::MAX {
// SAFETY: testing if invalid char is alphabetic would panic?
let c: char = unsafe { std::mem::transmute(idx) };
std::hint::black_box(c.is_alphabetic());
}
} Also as a quick patch(for panic, not correctness), we should use edited: we still need to found what's the source of illegal unicode thought |
I am currently trying to get DB to fail with all logging enabled. The query looks like this: INSERT INTO foo (fields...)
VALUES (...) (...) ... 1_000 rows in one batch. With only 100 rows per batch I was able to push all my data into the database. When I tried to push just the time range that caused the DB to fail, I got no errors. I tend to think this is some kind of back-pressure problem and somehow parser is getting truncated query. I'm going to push my data with 10_000 row batches but with sleep calls between each batch to slow down the data stream to see if the DB will fail in this case once I finish the run with all logging enabled. |
The opensrv crate already validates the string so the input string to the parser should be valid, I think. @discord9 |
To be clear |
It appears that there is not enough information in the debug log 😢 I only see the parser parsing the input query. I couldn't reproduce this using the query in the debug log.
Would you mind sharing your project with us? You can remove your sensitive information from it and only provide a minimal program that can reproduce this issue. Then we can debug this locally.
You can also enable all the debug logs to see if there are other helpful messages.
|
Unfortunately I can't reproduce the problem with all logs enabled due to lack of disc space. |
Thanks! |
Neither can I reproduce with CREATE TABLE public_trades (
exchange STRING,
symbol STRING,
ts TIMESTAMP TIME INDEX,
price DOUBLE,
amount DOUBLE,
side STRING,
PRIMARY KEY (exchange, symbol)
); and the insert sql from log file, is there more instruction for how to reproduce it? Maybe run the db with gdb and set breakpoint on |
I am able to reproduce the error with small amount of data and full logging enabled using MySQLdb library. Log attached to this message. greptimedb-err.2024-09-09-12.gz
I have used MySQLdb to insert all my data but with different tags, not uuid but two short tags, with no problem. I'll share data and code in a few days. |
We guess this is caused by databendlabs/opensrv#49 The |
Now we can also reliably reproduce the issue, we are working on fix that data racing from |
This explains why I cannot consistently get these errors. Here is my test script and data: Thank you. |
Close by #4732 |
What type of bug is this?
Crash
What subsystems are affected?
Standalone mode
Minimal reproduce step
I am having an issue while inserting a lot of data (~100M rows) in to database. Crash seems to appear at stable points but this point changes when I change data order and insert batch size.
I am unable to reproduce this issue with synthetic data.
I am inserting data from python using
mysql-connector-python
.What did you expect to see?
All data in database.
What did you see instead?
Mysql client exits with error.
What operating system did you use?
ArchLinux x64
What version of GreptimeDB did you use?
0.9.3 from docker.io
Relevant log output and stack trace
The text was updated successfully, but these errors were encountered: