bitflicker64 commented on code in PR #3349:
URL: https://github.com/apache/hugegraph/pull/3349#discussion_r4277450145


##########
helm/hugegraph/templates/tests/test-connection.yaml:
##########
@@ -16,6 +16,17 @@
 #
 
 {{ include "hugegraph.resolveValues" . }}
+{{- $smoke := `def ids = [] as Set;
+(graph.schema().getVertexLabels() + graph.schema().getEdgeLabels()).each {
+    ids.addAll(it.indexLabels())
+};
+ids.each {
+    def index = graph.indexLabel(it);
+    if (index.status().name() == 'INVALID') {

Review Comment:
   Important: The hook fails only on `INVALID`, but a Server Pod can hold a 
stale `CREATING` or `REBUILDING` index label through the same mechanism this PR 
targets, and every indexed query on that Pod then fails while `helm test` 
passes. On hstore, index status changes are saved without a cache broadcast: 
`IndexLabelRebuildJob` moves `CREATING`/`REBUILDING` to `CREATED` through 
`updateSchemaStatus()` (lines 106 and 143), `SchemaTransactionV2.saveSchema()` 
writes `INDEX_LABEL` with no notify (line 451), and 
`CachedSchemaTransactionV2.updateSchema()` deliberately skips 
`notifySchemaCacheClear()` (comment at line 357). Any Pod that read the index 
during the build, by an indexed query, a vertex write on that label, or this 
hook's own `graph.indexLabel(id)` (which caches through `getSchema()` line 
438), keeps `CREATING`. The query path then rejects it: 
`GraphIndexTransaction.validateIndexLabel()` requires `status().ok()`, which is 
`CREATED` only, and throws "Can't query by label index ...
  in status CREATING(CREATED expected)". A stale `INVALID` arises the same way, 
so this check catches one of several states with the same symptom. Please fail 
on any status other than `CREATED`, for example `if (!index.status().ok()) { 
throw new IllegalStateException('index ' + index.name() + ' is ' + 
index.status()) }`, and let the existing retry window absorb a build that 
finishes before the deadline. Update `docs/operations.md` line 293 ("Normal 
index creation/rebuild states are not rejected") and README line 193 to match, 
and say that `helm test` should run after index jobs finish.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to