SHDP-444 Backport of partition writer enhacements

- Bring back changes from SHDP-436 and SHDP-423 as is
  from master except of append support.
- Didn't port any new tests because in master those are
  using minicluster.