nucliadb 6.3.5.post3996__py3-none-any.whl → 6.3.5.post4010__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/base.py +2 -18
- nucliadb/common/cluster/rollover.py +6 -9
- nucliadb/common/cluster/utils.py +0 -7
- nucliadb/common/nidx.py +0 -11
- nucliadb/ingest/service/writer.py +0 -22
- nucliadb/search/requesters/utils.py +1 -3
- {nucliadb-6.3.5.post3996.dist-info → nucliadb-6.3.5.post4010.dist-info}/METADATA +6 -6
- {nucliadb-6.3.5.post3996.dist-info → nucliadb-6.3.5.post4010.dist-info}/RECORD +11 -11
- {nucliadb-6.3.5.post3996.dist-info → nucliadb-6.3.5.post4010.dist-info}/WHEEL +0 -0
- {nucliadb-6.3.5.post3996.dist-info → nucliadb-6.3.5.post4010.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.3.5.post3996.dist-info → nucliadb-6.3.5.post4010.dist-info}/top_level.txt +0 -0
nucliadb/common/cluster/base.py
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
20
|
from abc import ABCMeta, abstractmethod
|
21
|
-
from typing import AsyncIterator
|
21
|
+
from typing import AsyncIterator
|
22
22
|
|
23
23
|
from nucliadb_protos import nodereader_pb2, noderesources_pb2, utils_pb2
|
24
24
|
from nucliadb_protos.nodereader_pb2_grpc import NodeReaderStub
|
@@ -38,31 +38,15 @@ class AbstractIndexNode(metaclass=ABCMeta):
|
|
38
38
|
self,
|
39
39
|
*,
|
40
40
|
id: str,
|
41
|
-
address: str,
|
42
|
-
shard_count: int,
|
43
|
-
available_disk: int,
|
44
|
-
dummy: bool = False,
|
45
|
-
primary_id: Optional[str] = None,
|
46
41
|
):
|
47
42
|
self.id = id
|
48
|
-
self.address = address
|
49
|
-
self.shard_count = shard_count
|
50
|
-
self.available_disk = available_disk
|
51
|
-
self.dummy = dummy
|
52
|
-
self.primary_id = primary_id
|
53
43
|
|
54
44
|
def __str__(self):
|
55
|
-
|
56
|
-
return f"{self.__class__.__name__}({self.id}, {self.address})"
|
57
|
-
else:
|
58
|
-
return f"{self.__class__.__name__}({self.id}, {self.address}, primary_id={self.primary_id})"
|
45
|
+
return f"{self.__class__.__name__}({self.id}"
|
59
46
|
|
60
47
|
def __repr__(self):
|
61
48
|
return self.__str__()
|
62
49
|
|
63
|
-
def is_read_replica(self) -> bool:
|
64
|
-
return self.primary_id is not None
|
65
|
-
|
66
50
|
@property
|
67
51
|
@abstractmethod
|
68
52
|
def reader(self) -> NodeReaderStub: # pragma: no cover
|
@@ -54,7 +54,6 @@ class UnexpectedRolloverError(Exception):
|
|
54
54
|
async def create_rollover_index(
|
55
55
|
app_context: ApplicationContext,
|
56
56
|
kbid: str,
|
57
|
-
drain_nodes: Optional[list[str]] = None,
|
58
57
|
external: Optional[ExternalIndexManager] = None,
|
59
58
|
) -> None:
|
60
59
|
"""
|
@@ -63,7 +62,7 @@ async def create_rollover_index(
|
|
63
62
|
it is used to store the rollover state during the rollover. However, the actual indexing will be done
|
64
63
|
by the external index provider.
|
65
64
|
"""
|
66
|
-
await create_rollover_shards(app_context, kbid
|
65
|
+
await create_rollover_shards(app_context, kbid)
|
67
66
|
if external is not None:
|
68
67
|
if external.supports_rollover:
|
69
68
|
await create_rollover_external_index(kbid, external)
|
@@ -100,11 +99,11 @@ async def create_rollover_external_index(kbid: str, external: ExternalIndexManag
|
|
100
99
|
|
101
100
|
|
102
101
|
async def create_rollover_shards(
|
103
|
-
app_context: ApplicationContext,
|
102
|
+
app_context: ApplicationContext,
|
103
|
+
kbid: str,
|
104
104
|
) -> writer_pb2.Shards:
|
105
105
|
"""
|
106
106
|
Creates new index node shards for a rollover operation.
|
107
|
-
If drain_nodes is provided, no replicas will be created on those nodes.
|
108
107
|
"""
|
109
108
|
|
110
109
|
logger.info("Creating rollover shards", extra={"kbid": kbid})
|
@@ -583,7 +582,8 @@ async def clean_rollover_status(app_context: ApplicationContext, kbid: str) -> N
|
|
583
582
|
|
584
583
|
|
585
584
|
async def rollover_kb_index(
|
586
|
-
app_context: ApplicationContext,
|
585
|
+
app_context: ApplicationContext,
|
586
|
+
kbid: str,
|
587
587
|
) -> None:
|
588
588
|
"""
|
589
589
|
Rollover a KB index is the process of creating new shard replicas for every
|
@@ -592,9 +592,6 @@ async def rollover_kb_index(
|
|
592
592
|
|
593
593
|
Once all the data is in the new indexes, cut over to the replicated index delete the old one.
|
594
594
|
|
595
|
-
If drain_nodes is provided, no index node replicas will be created on those nodes. This is useful
|
596
|
-
for when we want to remove a set of nodes from the index node cluster.
|
597
|
-
|
598
595
|
This is a very expensive operation and should be done with care.
|
599
596
|
|
600
597
|
Process:
|
@@ -612,7 +609,7 @@ async def rollover_kb_index(
|
|
612
609
|
logger.info("Rolling over KB index", extra=extra)
|
613
610
|
|
614
611
|
async with locking.distributed_lock(locking.KB_SHARDS_LOCK.format(kbid=kbid)):
|
615
|
-
await create_rollover_index(app_context, kbid,
|
612
|
+
await create_rollover_index(app_context, kbid, external=external)
|
616
613
|
await schedule_resource_indexing(app_context, kbid)
|
617
614
|
await index_to_rollover_index(app_context, kbid, external=external)
|
618
615
|
await cutover_index(app_context, kbid, external=external)
|
nucliadb/common/cluster/utils.py
CHANGED
@@ -43,8 +43,6 @@ logger = logging.getLogger(__name__)
|
|
43
43
|
|
44
44
|
_lock = asyncio.Lock()
|
45
45
|
|
46
|
-
_STANDALONE_SERVER = "_standalone_service"
|
47
|
-
|
48
46
|
|
49
47
|
async def setup_cluster() -> Union[KBShardManager, StandaloneKBShardManager]:
|
50
48
|
async with _lock:
|
@@ -65,11 +63,6 @@ async def teardown_cluster():
|
|
65
63
|
if get_utility(Utility.SHARD_MANAGER):
|
66
64
|
clean_utility(Utility.SHARD_MANAGER)
|
67
65
|
|
68
|
-
std_server = get_utility(_STANDALONE_SERVER)
|
69
|
-
if std_server is not None:
|
70
|
-
await std_server.stop(None)
|
71
|
-
clean_utility(_STANDALONE_SERVER)
|
72
|
-
|
73
66
|
|
74
67
|
def get_shard_manager() -> KBShardManager:
|
75
68
|
return get_utility(Utility.SHARD_MANAGER) # type: ignore
|
nucliadb/common/nidx.py
CHANGED
@@ -279,21 +279,10 @@ class FakeNode(AbstractIndexNode):
|
|
279
279
|
def writer(self):
|
280
280
|
return self.client
|
281
281
|
|
282
|
-
def is_read_replica(_):
|
283
|
-
return False
|
284
|
-
|
285
282
|
@property
|
286
283
|
def id(self):
|
287
284
|
return "nidx"
|
288
285
|
|
289
|
-
@property
|
290
|
-
def address(self):
|
291
|
-
return "nidx"
|
292
|
-
|
293
|
-
@property
|
294
|
-
def primary_id(self):
|
295
|
-
return "nidx"
|
296
|
-
|
297
286
|
|
298
287
|
def get_nidx_fake_node() -> FakeNode:
|
299
288
|
nidx = get_nidx()
|
@@ -24,7 +24,6 @@ from nucliadb.backups import tasks as backup_tasks
|
|
24
24
|
from nucliadb.backups import utils as backup_utils
|
25
25
|
from nucliadb.common import datamanagers
|
26
26
|
from nucliadb.common.cluster.exceptions import AlreadyExists, EntitiesGroupNotFound
|
27
|
-
from nucliadb.common.cluster.manager import get_nidx_fake_node
|
28
27
|
from nucliadb.common.cluster.utils import get_shard_manager
|
29
28
|
from nucliadb.common.datamanagers.exceptions import KnowledgeBoxNotFound
|
30
29
|
from nucliadb.common.external_index_providers.exceptions import ExternalIndexCreationError
|
@@ -59,8 +58,6 @@ from nucliadb_protos.writer_pb2 import (
|
|
59
58
|
IndexStatus,
|
60
59
|
ListEntitiesGroupsRequest,
|
61
60
|
ListEntitiesGroupsResponse,
|
62
|
-
ListMembersRequest,
|
63
|
-
ListMembersResponse,
|
64
61
|
NewEntitiesGroupRequest,
|
65
62
|
NewEntitiesGroupResponse,
|
66
63
|
OpStatusWriter,
|
@@ -407,25 +404,6 @@ class WriterServicer(writer_pb2_grpc.WriterServicer):
|
|
407
404
|
|
408
405
|
return response
|
409
406
|
|
410
|
-
async def ListMembers( # type: ignore
|
411
|
-
self, request: ListMembersRequest, context=None
|
412
|
-
) -> ListMembersResponse:
|
413
|
-
response = ListMembersResponse()
|
414
|
-
response.members.extend(
|
415
|
-
[
|
416
|
-
writer_pb2.Member(
|
417
|
-
id=n.id,
|
418
|
-
listen_address=n.address,
|
419
|
-
is_self=False,
|
420
|
-
dummy=n.dummy,
|
421
|
-
shard_count=n.shard_count,
|
422
|
-
primary_id=n.primary_id or "",
|
423
|
-
)
|
424
|
-
for n in [get_nidx_fake_node()]
|
425
|
-
]
|
426
|
-
)
|
427
|
-
return response
|
428
|
-
|
429
407
|
async def Index(self, request: IndexResource, context=None) -> IndexStatus: # type: ignore
|
430
408
|
async with self.driver.transaction() as txn:
|
431
409
|
kbobj = KnowledgeBoxORM(txn, self.storage, request.kbid)
|
@@ -209,9 +209,7 @@ def debug_nodes_info(nodes: list[tuple[AbstractIndexNode, str]]) -> list[dict[st
|
|
209
209
|
info = {
|
210
210
|
"id": node.id,
|
211
211
|
"shard_id": shard_id,
|
212
|
-
"address":
|
212
|
+
"address": "nidx",
|
213
213
|
}
|
214
|
-
if node.primary_id:
|
215
|
-
info["primary_id"] = node.primary_id
|
216
214
|
details.append(info)
|
217
215
|
return details
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.3.5.
|
3
|
+
Version: 6.3.5.post4010
|
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.3.5.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.5.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.3.5.
|
26
|
-
Requires-Dist: nucliadb-models>=6.3.5.
|
27
|
-
Requires-Dist: nidx-protos>=6.3.5.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.3.5.post4010
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.5.post4010
|
25
|
+
Requires-Dist: nucliadb-protos>=6.3.5.post4010
|
26
|
+
Requires-Dist: nucliadb-models>=6.3.5.post4010
|
27
|
+
Requires-Dist: nidx-protos>=6.3.5.post4010
|
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[standard]
|
@@ -57,16 +57,16 @@ nucliadb/common/constants.py,sha256=QpigxJh_CtD85Evy0PtV5cVq6x0U_f9xfIcXz1ymkUg,
|
|
57
57
|
nucliadb/common/counters.py,sha256=8lOi3A2HeLDDlcNaS2QT1SfD3350VPBjiY3FkmHH1V8,977
|
58
58
|
nucliadb/common/ids.py,sha256=4QjoIofes_vtKj2HsFWZf8VVIVWXxdkYtLpx1n618Us,8239
|
59
59
|
nucliadb/common/locking.py,sha256=RL0CabZVPzxHZyUjYeUyLvsJTm7W3J9o4fEgsY_ufNc,5896
|
60
|
-
nucliadb/common/nidx.py,sha256=
|
60
|
+
nucliadb/common/nidx.py,sha256=y2P5DwElqOqdYI7FIpslkTp6wxscohrJmSqRYfMJA_w,10067
|
61
61
|
nucliadb/common/cluster/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
62
|
-
nucliadb/common/cluster/base.py,sha256=
|
62
|
+
nucliadb/common/cluster/base.py,sha256=p_KcAMX0ij2D3vllWCFx2hK5IiYjSHHvfZ1Jwks7JYg,4926
|
63
63
|
nucliadb/common/cluster/exceptions.py,sha256=t7v_l93t44l2tQpdQXgO_w-c4YZRcaayOz1A2i0w4RQ,1258
|
64
64
|
nucliadb/common/cluster/grpc_node_dummy.py,sha256=LxONv0mhDFhx7mI91qqGfQlQ-R0qOGDYaxhXoBHLXaE,3548
|
65
65
|
nucliadb/common/cluster/manager.py,sha256=KIzqAYGgdVK3GicJ9LdLoei8arWZ7H60imbc32USPj4,12754
|
66
66
|
nucliadb/common/cluster/rebalance.py,sha256=cLUlR08SsqmnoA_9GDflV6k2tXmkAPpyFxZErzp45vo,8754
|
67
|
-
nucliadb/common/cluster/rollover.py,sha256=
|
67
|
+
nucliadb/common/cluster/rollover.py,sha256=WhiLzNI520RJZ_Si6wEQgWyZu92D7ijO8_3wh2OawLE,25648
|
68
68
|
nucliadb/common/cluster/settings.py,sha256=JPwV_0U_i618Tn66GWUq6qCKNjy4TWkGEGld9GwH5uk,2048
|
69
|
-
nucliadb/common/cluster/utils.py,sha256=
|
69
|
+
nucliadb/common/cluster/utils.py,sha256=K0BZ75m12Tbi7KS1Tr3LqXJSPhJzUHkBMo4j8W8nQpA,4639
|
70
70
|
nucliadb/common/cluster/standalone/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
71
71
|
nucliadb/common/cluster/standalone/utils.py,sha256=af3r-x_GF7A6dwIAhZLR-r-SZQEVxsFrDKeMfUTA6G0,1908
|
72
72
|
nucliadb/common/context/__init__.py,sha256=ZLUvKuIPaolKeA3aeZa2JcHwCIaEauNu8WpdKsiINXo,3354
|
@@ -159,7 +159,7 @@ nucliadb/ingest/orm/processor/processor.py,sha256=q2iBJJ_5SV_bxA3t5MrbV70iQhir94
|
|
159
159
|
nucliadb/ingest/orm/processor/sequence_manager.py,sha256=uqEphtI1Ir_yk9jRl2gPf7BlzzXWovbARY5MNZSBI_8,1704
|
160
160
|
nucliadb/ingest/service/__init__.py,sha256=MME_G_ERxzJR6JW_hfE2qcfXpmpH1kdG-S0a-M0qRm8,2043
|
161
161
|
nucliadb/ingest/service/exceptions.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
162
|
-
nucliadb/ingest/service/writer.py,sha256=
|
162
|
+
nucliadb/ingest/service/writer.py,sha256=EN-qEDJnL5in7cs1lC-z6b4ui_byFJMJ5huyCtwR_sU,21637
|
163
163
|
nucliadb/middleware/__init__.py,sha256=A8NBlBuEkunCFMKpR9gnfNELsVn0Plc55BIQMbWDM8Q,2202
|
164
164
|
nucliadb/migrator/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
165
165
|
nucliadb/migrator/command.py,sha256=dKbJ1tAmP6X4lMVRSSlz351euaqs2wBPpOczLjATUes,2089
|
@@ -225,7 +225,7 @@ nucliadb/search/api/v1/resource/ingestion_agents.py,sha256=fqqRCd8Wc9GciS5P98lcn
|
|
225
225
|
nucliadb/search/api/v1/resource/search.py,sha256=yULbW3SQ9PjISw8ge-Ivgx6gxR3CJdVH8n-pXWJFgig,5189
|
226
226
|
nucliadb/search/api/v1/resource/utils.py,sha256=-NjZqAQtFEXKpIh8ui5S26ItnJ5rzmmG0BHxGSS9QPw,1141
|
227
227
|
nucliadb/search/requesters/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
228
|
-
nucliadb/search/requesters/utils.py,sha256=
|
228
|
+
nucliadb/search/requesters/utils.py,sha256=cQZ4-NftiMljoWQ7-Zl7nWfr6u_FY8u_wc9kTvKQcAg,6999
|
229
229
|
nucliadb/search/search/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
230
230
|
nucliadb/search/search/cache.py,sha256=n9vkN6Y6Xnr2RBJyoH0WzjzGTJOMfKekU9tfPTWWCPc,6810
|
231
231
|
nucliadb/search/search/cut.py,sha256=ytY0_GY7ocNjfxTb4aosxEp4ZfhQNDP--JkhEMGD298,1153
|
@@ -360,8 +360,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
360
360
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
361
361
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
362
362
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
363
|
-
nucliadb-6.3.5.
|
364
|
-
nucliadb-6.3.5.
|
365
|
-
nucliadb-6.3.5.
|
366
|
-
nucliadb-6.3.5.
|
367
|
-
nucliadb-6.3.5.
|
363
|
+
nucliadb-6.3.5.post4010.dist-info/METADATA,sha256=TTdOvczaWksu8xom0t1nX1pM5i5EnXT3Jxvf5HmV6IY,4301
|
364
|
+
nucliadb-6.3.5.post4010.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
365
|
+
nucliadb-6.3.5.post4010.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
366
|
+
nucliadb-6.3.5.post4010.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
367
|
+
nucliadb-6.3.5.post4010.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|