-
Notifications
You must be signed in to change notification settings - Fork 342
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
fix: ignore chunks too short OR not not seems to pattern .00...N #1615
base: trunk
Are you sure you want to change the base?
Conversation
Some debug output for invalid chunk_name_to_file_name(): 241107 10:12:15 xbcloud: add key: '20241105-shrinked2/ddl_log.log.qp.00000000000000000001' 241107 10:12:15 xbcloud: add key: '20241105-shrinked2/done' 241107 10:12:15 xbcloud: add key: '20241105-shrinked2/ib_buffer_pool.qp.00000000000000000000' -- 241107 10:12:15 xbcloud: Check chunk: '20241105-shrinked2/ddl_log.log.qp.00000000000000000001' 241107 10:12:15 xbcloud: Append chunk: '20241105-shrinked2/ddl_log.log.qp' : 1 241107 10:12:15 xbcloud: Check chunk: '20241105-shrinked2/done' 241107 10:12:15 xbcloud: Append chunk: '20' : 41105 Chunk name '20241105-shrinked2/done' has 23 chars (but not contains '.'), so it splits to filename '20' and idx '241105-shrinked2/done', then atoll cast idx to '241105'.
@@ -1038,10 +1038,16 @@ bool xbcloud_put(Object_store *store, const std::string &container, | |||
@return true in case of success or false otherwise */ | |||
bool chunk_name_to_file_name(const std::string &chunk_name, | |||
std::string &file_name, my_off_t &idx) { | |||
if (chunk_name.size() < 22 && chunk_name[chunk_name.size() - 21] != '.') { | |||
if (chunk_name.size() < 22 || chunk_name[chunk_name.size() - 21] != '.') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was noted in another #1538. Technically, it is a problem but not seen in the real world because of the minimum prefix length uploaded.
We can accept this.
auto slash_pos = chunk_name.find('/'); | ||
if (slash_pos && chunk_name.size() - slash_pos < 22) { | ||
/* '/' must be placed left side from '.' */ | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I more interested to know about your done file.
- Why do you do it?
- Do you upload 'done' file for every chunk or file?
- Did you modify xbcloud logic to do it? If you are doing externally, do you do it after the backup is uploaded to S3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay.
- file
done
uses as finish-flag in backup script to detect incompleted backup (I run xtrabackup on several replicas) - file
done
is single file, it uploaded once time - xbcloud not modified,
done
uploads when xbcloud successfully finished
I tried download backup from S3 and got error:
Some debug output for chunks processing:
Chunk name '20241105-shrinked2/done' has 23 chars (but not contains '.'), so it splits to filename '20' and idx '241105-shrinked2/done', then atoll cast idx to '241105'.
File 'done' uploaded to bucket by my backup script as finish-flag.
I append checks for right placement for
/
also: it must be left side of '.'