presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/DatabaseShardRecorder.java/DatabaseShardRecorder/recordCreatedShard
class DatabaseShardRecorder:    @Override
    public void recordCreatedShard(long transactionId, UUID shardUuid)
    {
        int maxAttempts = 5;
        for (int attempt = 1; attempt <= maxAttempts; attempt++) {
            try {
                runIgnoringConstraintViolation(() -> dao.insertCreatedShard(shardUuid, transactionId));
                return;
            }
            catch (PrestoException e) {
                if (attempt == maxAttempts) {
                    throw e;
                }
                log.warn(e, "Failed to insert created shard on attempt %s, will retry", attempt);
                try {
                    long millis = attempt * 2000L;
                    MILLISECONDS.sleep(millis + ThreadLocalRandom.current().nextLong(0, millis));
                }
                catch (InterruptedException ie) {
                    throw metadataError(ie);
                }
            }
        }
    }