void updatePartitionInfo(StickyPartitionInfo partitionInfo, int appendedBytes, Cluster cluster) {
        updatePartitionInfo(partitionInfo, appendedBytes, cluster, true);
    }
Update partition info with the number of bytes appended and maybe switch partition.
NOTE this function needs to be called under the partition's batch queue lock.

@param partitionInfo The sticky partition info object returned by peekCurrentPartitionInfo
@param appendedBytes The number of bytes appended to this partition
@param cluster The cluster information
clients/src/main/java/org/apache/kafka/clients/producer/internals/BuiltInPartitioner.java