Files
qdrant/tests/consensus_tests/test_update_concurrency.py
Di Zhao 8c79041552 Add update_concurrency option to control the parallelism of shard updates (#2599)
* add update_concurrency to control the parallelism of updating shards

* reformat the files

* reformat

* add update_concurrency control to shard updates

* use unwrap_or

* test using buffer_ordered

* use buffered (testing)

* Pre-allocate space for update futures

* use NonZeroUsize

* linter

* use NonZeroUsize in the test

* consensus test for update_concurrency

* update config commit

---------

Co-authored-by: Di Zhao <diz@twitter.com>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-09-12 20:21:19 +02:00

36 lines
909 B
Python

import logging
import pathlib
from .fixtures import create_collection, upsert_random_points, count_counts
from .utils import *
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
N_PEERS = 3
N_SHARDS = 1
N_REPLICAS = 2
COLLECTION_NAME = "test_collection"
def test_listener_node(tmp_path: pathlib.Path):
assert_project_root()
peer_api_uris, peer_dirs, bootstrap_uri = start_cluster(
tmp_path,
N_PEERS,
extra_env={
"QDRANT__STORAGE__UPDATE_CONCURRENCY": "1",
}
)
create_collection(peer_api_uris[0], shard_number=N_SHARDS, replication_factor=N_REPLICAS)
wait_collection_exists_and_active_on_all_peers(collection_name=COLLECTION_NAME, peer_api_uris=peer_api_uris)
upsert_random_points(peer_api_uris[0], 100)
for uri in peer_api_uris:
count = count_counts(uri, COLLECTION_NAME)
assert count == 100