private synchronized String createNonSequential(String path, byte[] data, List<ACL> acl,
            CreateMode createMode)
            throws KeeperException, InterruptedException {
        RetryCounter retryCounter = retryCounterFactory.create();
        boolean isRetry = false; // False for first attempt, true for all
        // retries.
        while (true) {
            try {
                return zk.create(path, data, acl, createMode);
            } catch (KeeperException e) {
                ensureConnectivity(e);

                switch (e.code()) {
                    case NODEEXISTS:
                        if (isRetry) {
                            // If the connection was lost, there is still a
                            // possibility that
                            // we have successfully created the node at our previous
                            // attempt,
                            // so we read the node and compare.
                            byte[] currentData = zk.getData(path, false, null);
                            if (currentData != null && Bytes.compareTo(currentData, data) == 0) {
                                // We successfully created a non-sequential node
                                return path;
                            }
                            logger.error("Node " + path + " already exists with "
                                    + Bytes.toStringBinary(currentData) + ", could not write "
                                    + Bytes.toStringBinary(data));
                            throw e;
                        }
                        // logger.debug("Node " + path +
                        // " already exists and this is not a " + "retry");
                        throw e;

                    case CONNECTIONLOSS:
                    case SESSIONEXPIRED:
                    case OPERATIONTIMEOUT:
                        retryOrThrow(retryCounter, e, "create");
                        break;

                    default:
                        throw e;
                }
            }
            retryCounter.sleepUntilNextRetry();
            retryCounter.useRetry();
            isRetry = true;
        }
    }
NONSEQUENTIAL create is idempotent operation. Retry before throwing exceptions. But this
function will not throw the NodeExist exception back to the application. </p> <p> But
SEQUENTIAL is NOT idempotent operation. It is necessary to add identifier to the path to
verify, whether the previous one is successful or not. </p>

@return Path
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/zookeeper/RecoverableZooKeeper.java