[TO_STAGE] backport of marek's origin-server/pull/2949