nucliadb 6.2.1.post3332__py3-none-any.whl → 6.2.1.post3365__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nucliadb/common/cluster/rebalance.py +1 -9
- nucliadb/common/cluster/rollover.py +0 -12
- nucliadb/common/cluster/utils.py +0 -30
- nucliadb/common/context/__init__.py +0 -6
- nucliadb/ingest/app.py +1 -7
- {nucliadb-6.2.1.post3332.dist-info → nucliadb-6.2.1.post3365.dist-info}/METADATA +6 -6
- {nucliadb-6.2.1.post3332.dist-info → nucliadb-6.2.1.post3365.dist-info}/RECORD +10 -10
- {nucliadb-6.2.1.post3332.dist-info → nucliadb-6.2.1.post3365.dist-info}/WHEEL +0 -0
- {nucliadb-6.2.1.post3332.dist-info → nucliadb-6.2.1.post3365.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.2.1.post3332.dist-info → nucliadb-6.2.1.post3365.dist-info}/top_level.txt +0 -0
@@ -31,7 +31,7 @@ from nucliadb_telemetry.utils import setup_telemetry
|
|
31
31
|
from nucliadb_utils.fastapi.run import serve_metrics
|
32
32
|
|
33
33
|
from .settings import settings
|
34
|
-
from .utils import delete_resource_from_shard, index_resource_to_shard
|
34
|
+
from .utils import delete_resource_from_shard, index_resource_to_shard
|
35
35
|
|
36
36
|
logger = logging.getLogger(__name__)
|
37
37
|
|
@@ -151,14 +151,6 @@ async def move_set_of_kb_resources(
|
|
151
151
|
extra={"kbid": kbid, "resource_id": resource_id},
|
152
152
|
)
|
153
153
|
|
154
|
-
node_ids = set()
|
155
|
-
for replica in from_shard.replicas:
|
156
|
-
node_ids.add(replica.node)
|
157
|
-
for replica in to_shard.replicas:
|
158
|
-
node_ids.add(replica.node)
|
159
|
-
for node_id in node_ids:
|
160
|
-
await wait_for_node(context, node_id)
|
161
|
-
|
162
154
|
|
163
155
|
async def rebalance_kb(context: ApplicationContext, kbid: str) -> None:
|
164
156
|
await maybe_add_shard(kbid)
|
@@ -39,7 +39,6 @@ from .utils import (
|
|
39
39
|
get_resource,
|
40
40
|
get_resource_index_message,
|
41
41
|
index_resource_to_shard,
|
42
|
-
wait_for_node,
|
43
42
|
)
|
44
43
|
|
45
44
|
logger = logging.getLogger(__name__)
|
@@ -232,7 +231,6 @@ async def index_to_rollover_index(
|
|
232
231
|
return
|
233
232
|
|
234
233
|
logger.info("Indexing to rollover index", extra=extra)
|
235
|
-
wait_index_batch: list[writer_pb2.ShardObject] = []
|
236
234
|
# now index on all new shards only
|
237
235
|
while True:
|
238
236
|
async with datamanagers.with_transaction() as txn:
|
@@ -288,16 +286,6 @@ async def index_to_rollover_index(
|
|
288
286
|
modification_time=_to_ts(resource.basic.modified.ToDatetime()), # type: ignore
|
289
287
|
)
|
290
288
|
await txn.commit()
|
291
|
-
wait_index_batch.append(shard)
|
292
|
-
|
293
|
-
if len(wait_index_batch) > 10:
|
294
|
-
node_ids = set()
|
295
|
-
for shard_batch in wait_index_batch:
|
296
|
-
for replica in shard_batch.replicas:
|
297
|
-
node_ids.add(replica.node)
|
298
|
-
for node_id in node_ids:
|
299
|
-
await wait_for_node(app_context, node_id)
|
300
|
-
wait_index_batch = []
|
301
289
|
|
302
290
|
async with datamanagers.with_transaction() as txn:
|
303
291
|
state.resources_indexed = True
|
nucliadb/common/cluster/utils.py
CHANGED
@@ -30,8 +30,6 @@ from nucliadb.common.cluster.manager import (
|
|
30
30
|
from nucliadb.common.cluster.settings import settings
|
31
31
|
from nucliadb.ingest.orm.resource import Resource
|
32
32
|
from nucliadb_protos import nodereader_pb2, writer_pb2
|
33
|
-
from nucliadb_utils import const
|
34
|
-
from nucliadb_utils.settings import is_onprem_nucliadb
|
35
33
|
from nucliadb_utils.utilities import Utility, clean_utility, get_utility, set_utility
|
36
34
|
|
37
35
|
if TYPE_CHECKING: # pragma: no cover
|
@@ -76,34 +74,6 @@ def get_shard_manager() -> KBShardManager:
|
|
76
74
|
return get_utility(Utility.SHARD_MANAGER) # type: ignore
|
77
75
|
|
78
76
|
|
79
|
-
async def wait_for_node(app_context: ApplicationContext, node_id: str) -> None:
|
80
|
-
if is_onprem_nucliadb():
|
81
|
-
# On onprem deployments indexing is synchronous right now, so we don't need to wait
|
82
|
-
return
|
83
|
-
|
84
|
-
logged = False
|
85
|
-
while True:
|
86
|
-
# get raw js client
|
87
|
-
js = app_context.nats_manager.js
|
88
|
-
consumer_info = await js.consumer_info(
|
89
|
-
const.Streams.INDEX.name, const.Streams.INDEX.group.format(node=node_id)
|
90
|
-
)
|
91
|
-
if consumer_info.num_pending < 5:
|
92
|
-
return
|
93
|
-
|
94
|
-
if not logged:
|
95
|
-
logger.info(
|
96
|
-
f"Waiting for node to consume messages. {consumer_info.num_pending} messages left.",
|
97
|
-
extra={"node": node_id},
|
98
|
-
)
|
99
|
-
logged = True
|
100
|
-
# usually we consume around 3-4 messages/s with some eventual peaks of
|
101
|
-
# 10-30. If there are too many pending messages, we can wait more.
|
102
|
-
# We suppose 5 messages/s and don't wait more than 60s
|
103
|
-
sleep = min(max(2, consumer_info.num_pending / 5), 60)
|
104
|
-
await asyncio.sleep(sleep)
|
105
|
-
|
106
|
-
|
107
77
|
async def get_resource(kbid: str, resource_id: str) -> Optional[Resource]:
|
108
78
|
async with datamanagers.with_ro_transaction() as txn:
|
109
79
|
return await datamanagers.resources.get_resource(txn, kbid=kbid, rid=resource_id)
|
@@ -25,18 +25,15 @@ from nucliadb.common.cluster.utils import setup_cluster, teardown_cluster
|
|
25
25
|
from nucliadb.common.maindb.driver import Driver
|
26
26
|
from nucliadb.common.maindb.utils import setup_driver, teardown_driver
|
27
27
|
from nucliadb.common.nidx import start_nidx_utility, stop_nidx_utility
|
28
|
-
from nucliadb_utils.indexing import IndexingUtility
|
29
28
|
from nucliadb_utils.nats import NatsConnectionManager
|
30
29
|
from nucliadb_utils.partition import PartitionUtility
|
31
30
|
from nucliadb_utils.settings import indexing_settings
|
32
31
|
from nucliadb_utils.storages.storage import Storage
|
33
32
|
from nucliadb_utils.utilities import (
|
34
33
|
get_storage,
|
35
|
-
start_indexing_utility,
|
36
34
|
start_nats_manager,
|
37
35
|
start_partitioning_utility,
|
38
36
|
start_transaction_utility,
|
39
|
-
stop_indexing_utility,
|
40
37
|
stop_nats_manager,
|
41
38
|
stop_partitioning_utility,
|
42
39
|
stop_transaction_utility,
|
@@ -49,7 +46,6 @@ class ApplicationContext:
|
|
49
46
|
shard_manager: KBShardManager
|
50
47
|
blob_storage: Storage
|
51
48
|
partitioning: PartitionUtility
|
52
|
-
indexing: IndexingUtility
|
53
49
|
nats_manager: NatsConnectionManager
|
54
50
|
|
55
51
|
def __init__(self, service_name: str = "service") -> None:
|
@@ -77,7 +73,6 @@ class ApplicationContext:
|
|
77
73
|
indexing_settings.index_jetstream_servers,
|
78
74
|
indexing_settings.index_jetstream_auth,
|
79
75
|
)
|
80
|
-
self.indexing = await start_indexing_utility()
|
81
76
|
self.transaction = await start_transaction_utility(self.service_name)
|
82
77
|
self.nidx = await start_nidx_utility()
|
83
78
|
|
@@ -88,7 +83,6 @@ class ApplicationContext:
|
|
88
83
|
await stop_nidx_utility()
|
89
84
|
await stop_transaction_utility()
|
90
85
|
if not in_standalone_mode():
|
91
|
-
await stop_indexing_utility()
|
92
86
|
await stop_nats_manager()
|
93
87
|
|
94
88
|
stop_partitioning_utility()
|
nucliadb/ingest/app.py
CHANGED
@@ -22,7 +22,6 @@ import importlib.metadata
|
|
22
22
|
from typing import Awaitable, Callable
|
23
23
|
|
24
24
|
from nucliadb import health
|
25
|
-
from nucliadb.common.cluster.settings import settings as cluster_settings
|
26
25
|
from nucliadb.common.cluster.utils import setup_cluster, teardown_cluster
|
27
26
|
from nucliadb.common.context import ApplicationContext
|
28
27
|
from nucliadb.common.nidx import start_nidx_utility
|
@@ -38,15 +37,13 @@ from nucliadb_telemetry.logs import setup_logging
|
|
38
37
|
from nucliadb_telemetry.utils import setup_telemetry
|
39
38
|
from nucliadb_utils.fastapi.run import serve_metrics
|
40
39
|
from nucliadb_utils.run import run_until_exit
|
41
|
-
from nucliadb_utils.settings import
|
40
|
+
from nucliadb_utils.settings import transaction_settings
|
42
41
|
from nucliadb_utils.utilities import (
|
43
42
|
start_audit_utility,
|
44
|
-
start_indexing_utility,
|
45
43
|
start_nats_manager,
|
46
44
|
start_partitioning_utility,
|
47
45
|
start_transaction_utility,
|
48
46
|
stop_audit_utility,
|
49
|
-
stop_indexing_utility,
|
50
47
|
stop_nats_manager,
|
51
48
|
stop_partitioning_utility,
|
52
49
|
stop_transaction_utility,
|
@@ -58,8 +55,6 @@ async def initialize() -> list[Callable[[], Awaitable[None]]]:
|
|
58
55
|
|
59
56
|
await setup_cluster()
|
60
57
|
await start_transaction_utility(SERVICE_NAME)
|
61
|
-
if not cluster_settings.standalone_mode and indexing_settings.index_jetstream_servers is not None:
|
62
|
-
await start_indexing_utility(SERVICE_NAME)
|
63
58
|
|
64
59
|
start_partitioning_utility()
|
65
60
|
|
@@ -70,7 +65,6 @@ async def initialize() -> list[Callable[[], Awaitable[None]]]:
|
|
70
65
|
finalizers = [
|
71
66
|
stop_partitioning_utility,
|
72
67
|
stop_transaction_utility,
|
73
|
-
stop_indexing_utility,
|
74
68
|
stop_audit_utility,
|
75
69
|
teardown_cluster,
|
76
70
|
]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.2.1.
|
3
|
+
Version: 6.2.1.post3365
|
4
4
|
Summary: NucliaDB
|
5
5
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
6
6
|
License: AGPL
|
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
21
21
|
Requires-Python: <4,>=3.9
|
22
22
|
Description-Content-Type: text/markdown
|
23
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.2.1.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.2.1.
|
26
|
-
Requires-Dist: nucliadb-models>=6.2.1.
|
27
|
-
Requires-Dist: nidx-protos>=6.2.1.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.2.1.post3365
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3365
|
25
|
+
Requires-Dist: nucliadb-protos>=6.2.1.post3365
|
26
|
+
Requires-Dist: nucliadb-models>=6.2.1.post3365
|
27
|
+
Requires-Dist: nidx-protos>=6.2.1.post3365
|
28
28
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
29
29
|
Requires-Dist: nuclia-models>=0.24.2
|
30
30
|
Requires-Dist: uvicorn
|
@@ -49,13 +49,13 @@ nucliadb/common/cluster/exceptions.py,sha256=V3c_fgH00GyJ-a5CaGLhwTuhwhUNR9YAGvS
|
|
49
49
|
nucliadb/common/cluster/grpc_node_dummy.py,sha256=L85wBnfab7Rev0CfsfUjPxQC6DiHPsETKrZAOLx9XHg,3510
|
50
50
|
nucliadb/common/cluster/index_node.py,sha256=g38H1kiAliF3Y6et_CWYInpn_xPxf7THAFJ7RtgLNZo,3246
|
51
51
|
nucliadb/common/cluster/manager.py,sha256=-y5PCUzxrvvUCBopmi8JztPiSBYYbUBeLer0XtO4Ukk,15383
|
52
|
-
nucliadb/common/cluster/rebalance.py,sha256=
|
53
|
-
nucliadb/common/cluster/rollover.py,sha256=
|
52
|
+
nucliadb/common/cluster/rebalance.py,sha256=cGrqc6GQ6Y2X1moW7NzIdLLsij0cbKySiu-qUa3fA-o,8700
|
53
|
+
nucliadb/common/cluster/rollover.py,sha256=iTJ9EQmHbzXL34foNFto-hqdC0Kq1pF1mNxqv0jqhBs,25362
|
54
54
|
nucliadb/common/cluster/settings.py,sha256=TMoym-cZsQ2soWfLAce0moSa2XncttQyhahL43LrWTo,3384
|
55
|
-
nucliadb/common/cluster/utils.py,sha256=
|
55
|
+
nucliadb/common/cluster/utils.py,sha256=7nQvnVFxM4XV7J560R8hUA-GPzrgD19UlQxHrl4mZUc,4687
|
56
56
|
nucliadb/common/cluster/standalone/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
57
57
|
nucliadb/common/cluster/standalone/utils.py,sha256=af3r-x_GF7A6dwIAhZLR-r-SZQEVxsFrDKeMfUTA6G0,1908
|
58
|
-
nucliadb/common/context/__init__.py,sha256=
|
58
|
+
nucliadb/common/context/__init__.py,sha256=ZLUvKuIPaolKeA3aeZa2JcHwCIaEauNu8WpdKsiINXo,3354
|
59
59
|
nucliadb/common/context/fastapi.py,sha256=j3HZ3lne6mIfw1eEar2het8RWzv6UruUZpXaKieSLOs,1527
|
60
60
|
nucliadb/common/datamanagers/__init__.py,sha256=U1cg-KvqbfzN5AnL_tFFrERmPb81w_0MNiTmxObmla4,2062
|
61
61
|
nucliadb/common/datamanagers/atomic.py,sha256=DU7RihO8WaGNuh_GTEpQ-8hkoinY5GSpNSzVpLsZh30,3225
|
@@ -101,7 +101,7 @@ nucliadb/export_import/models.py,sha256=dbjScNkiMRv4X3Ktudy1JRliD25bfoDTy3JmEZgQ
|
|
101
101
|
nucliadb/export_import/tasks.py,sha256=fpCBeFYPReyLIdk38LDM9Tpnw_VczeMrobT4n1RAIp4,2507
|
102
102
|
nucliadb/export_import/utils.py,sha256=zrNrkkc9i3uT-R6Ju4J_0WNrzayln3KuQFCz-_qIaIA,19613
|
103
103
|
nucliadb/ingest/__init__.py,sha256=fsw3C38VP50km3R-nHL775LNGPpJ4JxqXJ2Ib1f5SqE,1011
|
104
|
-
nucliadb/ingest/app.py,sha256=
|
104
|
+
nucliadb/ingest/app.py,sha256=n5PlZyrf-bJsrc6jMRSO4DTjGyZLb4q6EA6Y4x6TYfQ,7028
|
105
105
|
nucliadb/ingest/cache.py,sha256=w7jMMzamOmQ7gwXna6Dqm6isRNBVv6l5BTBlTxaYWjE,1005
|
106
106
|
nucliadb/ingest/partitions.py,sha256=2NIhMYbNT0TNBL6bX1UMSi7vxFGICstCKEqsB0TXHOE,2410
|
107
107
|
nucliadb/ingest/processing.py,sha256=gg1DqbMFwqdOsmCSGsZc2abRdYz86xOZJun9vrHOCzs,20618
|
@@ -336,8 +336,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
336
336
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
337
337
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
338
338
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
339
|
-
nucliadb-6.2.1.
|
340
|
-
nucliadb-6.2.1.
|
341
|
-
nucliadb-6.2.1.
|
342
|
-
nucliadb-6.2.1.
|
343
|
-
nucliadb-6.2.1.
|
339
|
+
nucliadb-6.2.1.post3365.dist-info/METADATA,sha256=g_650xn-beF0Qeo5H3cP5BlhSObncN0TJz-QOgA8VDk,4291
|
340
|
+
nucliadb-6.2.1.post3365.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
341
|
+
nucliadb-6.2.1.post3365.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
342
|
+
nucliadb-6.2.1.post3365.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
343
|
+
nucliadb-6.2.1.post3365.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|