v6: tenant updates are not split at the server's 100-tenant limit, so activate/deactivate fails above 100
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
Inizia da io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java, in particolare da update(List) e dai suoi chiamanti activate/deactivate. Controlla i test esistenti del client dei tenant e verifica che gli aggiornamenti con più di 100 elementi vengano inviati in batch, mentre create rimanga senza limiti; conferma che gli errori vengano propagati in modo coerente se un batch successivo ha esito negativo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
WeaviateTenantsClient.update(List<Tenant>) sends every tenant it is given in one
PUT /v1/schema/{class}/tenants. Weaviate caps that request at 100 tenants, so any
update of more than 100 fails:
HTTP 422: PUT /v1/schema/MyCollection/tenants: maximum number of tenants allowed to be
updated simultaneously is 100. Please reduce the number of tenants in your request and
try again
activate(...) and deactivate(...) are affected too, since both delegate to update.
The Python and TypeScript clients both split this request at 100 internally, so the same
code written against either of them works and the Java one does not. That difference is
also a trap for anyone measuring the limit: probing with the Python client reports "4000 in
one request, no cap", because it is quietly measuring the client's own batching rather than
the server's behaviour.
Reproduction
var tenants = client.collections.use("MyCollection").tenants;
List<String> names = IntStream.rangeClosed(1, 101)
.mapToObj(i -> "tenant-" + i)
.toList();
tenants.create(names.stream().map(Tenant::active).toList()); // fine: creates are not capped
tenants.deactivate(names); // HTTP 422
tenants.deactivate(names.subList(0, 100)) succeeds, which isolates the boundary.
Confirmed against Weaviate 1.39.0 at the REST layer as well, independently of the client:
PUT /v1/schema/{class}/tenants with 100 tenants -> 200
PUT /v1/schema/{class}/tenants with 101 tenants -> 422
Where the limit comes from
usecases/schema/tenant.go:
const ErrMsgMaxAllowedTenants = "maximum number of tenants allowed to be updated simultaneously is 100. ..."
func validateTenants(tenants []*models.Tenant, allowOverHundred bool) (validated []*models.Tenant, err error) {
if !allowOverHundred && len(tenants) > 100 {
err = uco.NewErrInvalidUserInput(ErrMsgMaxAllowedTenants)
return validated, err
}
AddTenants calls this with allowOverHundred=true and UpdateTenants with false, so
creating tenants is uncapped and only updating is limited. Any fix should keep that
asymmetry rather than chunking both.
What the other clients do
Python (weaviate/collections/tenants/executor.py, client 4.23.0):
UPDATE_TENANT_BATCH_SIZE = 100
...
batches = ceil(len(tenants) / UPDATE_TENANT_BATCH_SIZE)
TypeScript (src/collections/serialize/index.ts, client 3.14.0):
public static tenants<T, M>(tenants: T[], mapper: (tenant: T) => M): M[][] {
const mapped = [];
const batches = Math.ceil(tenants.length / 100);
for (let i = 0; i < batches; i++) {
const batch = tenants.slice(i * 100, (i + 1) * 100);
mapped.push(batch.map(mapper));
}
return mapped;
}
In both, the split is applied on the update path only, and create passes the whole list
through — matching the server.
Where it is in the Java client
io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java (6.3.1):
public void update(List<Tenant> tenants) throws IOException {
this.restTransport.performRequest(new UpdateTenantsRequest(tenants), UpdateTenantsRequest.endpoint(collection));
}
public void activate(List<String> tenants) throws IOException {
update(tenants.stream().map(Tenant::active).toList());
}
public void deactivate(List<String> tenants) throws IOException {
update(tenants.stream().map(Tenant::inactive).toList());
}
One performRequest for the whole list, and no chunking anywhere in the package.
Suggested fix
Split in update(List<Tenant>) at 100, so activate, deactivate and update are all
covered by the one change. Leave create alone.
Worth deciding explicitly what a partial failure means: with more than one request, a batch
can now fail after earlier batches have already been applied. Python and TypeScript both
leave the earlier batches applied and propagate the error.
- Lingua principale
- Java
- Stelle
- 34
- Fork
- 29
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di weaviate/java-client
-
v6: ShardReplica.shardName has no @SerializedName, so the shard is always nullForse già presa @dudanogueira l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
weaviate/java-client#621 ·
-
v6: Shard.vectorQueueLenght is misspelled, so the vector queue length is always 0Forse già presa @dudanogueira l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
weaviate/java-client#619 ·
-
v6: NvidiaReranker sends "baseUrl"; the module reads "baseURL"Forse già presa @dudanogueira l’ha presa 39 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
weaviate/java-client#607 ·
-
v6: rerank cannot be used with BM25, Hybrid or FetchObjectsForse già presa @dudanogueira l’ha presa 39 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
weaviate/java-client#603 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
weaviate/java-client#623 ·
Tutte le issue di weaviate/java-client
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/eo#9182 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
objectionary/hone-maven-plugin#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NixOS/nixpkgs#569828 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
MaikuB/flutter_appauth#683 ·