The return value indicates whether any batch IDs were written. AckWriter.finish() and Database.removeBatchesToAck() are only called if at least one batch ID was written.