Backport https://github.com/redpanda-data/redpanda/issues/15042 to branch v23.3.x. Requested by PR https://github.com/redpanda-data/redpanda/pull/16645