Skip to content

v1.0.0-alpha-296

@ignis-celestis ignis-celestis tagged this 27 Jul 13:57
stream() delegated to get(), which runs the body through bodyToString() and writes the
resulting string into a php://temp handle. It was a stream in name only — peak memory was
the object size, twice.

That did not make large artifacts slow, it made them unreadable. A 100 MB physical_base
backup against a 128 MB memory_limit died inside stream_get_contents with 'Allowed memory
size exhausted', so base backups could be WRITTEN and never RESTORED. Logical dumps are
~2.5 MB, so the weekly restore drills kept passing and reported nothing wrong. The WAL
archive was healthy and contiguous — 753 segments, no gaps — while the base backup it all
hangs off could not be read back. PITR was decorative end to end, which is the exact
failure the PITR recipe's own comment warns about.

The AWS SDK already returns a PSR-7 stream. StreamWrapper exposes it as a PHP resource
without reading it, so memory is now bounded by the consumer's chunk size instead of the
object size.

The regression test uses a body that throws from getContents()/__toString(), standing in
for 'too large to buffer': any future implementation that reads eagerly fails it.

Split from cd707c8febc83d7dd55935aca6f00c1644abff74
Assets 2
Loading