GCache file allocation may fail if file size is a multiple of page size

Bug #1259952 reported by Alex Yurchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Galera
Status tracked in 3.x
2.x
Fix Released
High
Alex Yurchenko
3.x
Fix Released
High
Alex Yurchenko
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

This may happen on file systems that don't support posix_fallocate(). The reason is offset == size_ case is not handled and falls through to throw exception.

Related branches

summary: - GCache file allocation may fail if files size if a multiple of page size
+ GCache file allocation may fail if file size if a multiple of page size
summary: - GCache file allocation may fail if file size if a multiple of page size
+ GCache file allocation may fail if file size is a multiple of page size
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Alex,

Has this actually happened on any instance? Asking since
posix_fallocate usually falls back to zero-writing on filesystems
where fallocate is not supported (which is why fallocate is less
used compared to posix_allocate in certain cases, since former
fails).

However, this may again fail but will be on platforms with very
old glibc (need to be really old AFAIK) where this fallback may
not have been implemented.

I tested with

wsrep_provider_options = "gmcast.listen_addr=tcp://127.0.0.1:4010; gcache.dir=/dev/shm/gcache; gcache.page_size=134217728; gcache.size=134217728; debug=1"

But was not able to get any crash here (it also changed the size
to a different value, not an exact multiple of 4096).

Revision history for this message
Alex Yurchenko (ayurchen) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1550

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.