Skip to content

fix: Relationship ordering in the pushdown, and two corRest tests - #62

Merged
kzangeli merged 1 commit into
mainfrom
q-broker-half-relationship-and-correst
Sep 4, 2026
Merged

fix: Relationship ordering in the pushdown, and two corRest tests#62
kzangeli merged 1 commit into
mainfrom
q-broker-half-relationship-and-correst

Conversation

@kzangeli

@kzangeli kzangeli commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Needs corNgsild#12 and corNgsild#13 merged first — the matrix's Relationship rows and url_param_join's expects are pinned against both.

Relationship ordering (§ 7.2.3.3)

The instance object is $$kv.v and carries its own type, so excluding a Relationship is one more conjunct. Two placements, and only one is right:

  • for the ordering operators, inside the per-instance predicate
  • for !~=, outside the negation — a guard inside the predicate that !~= negates turns "this target is excluded" into "this target matches". That's the third time today this trap has come up.

The string guard beside it had to widen at the same time, from "the target is a string" to "the target is a string or an array with a string in it", or A!~=urn dropped ["aaa","mid","zzz"] on mongoc alone.

Legacy itemType retired from both consumers

mongocEntityQuery and troeQTreeToSql now read itemTypeV directly. The fallback they carried was already dead: parseValueList is the only place that builds an LdQValueList, and it always allocates the per-item types. corNgsild can drop the field once this merges.

Two corRest tests — and only one covers what it looks like

test covers
distop_query_big_response a forwarded query whose response outgrows the engine's 8 KB read buffer. Verified to reach the doubling — instrumented, fires once
distop_query_pooled_connection_reuse a forwarded query survives the Context Source restarting, pooled socket and all

⚠️ The second does not cover the fromPool && !retried retry blocks, and its header says so. Instrumenting proved it: the second query does take the pooled socket (POOLGET hits, so the liveness probe doesn't catch the death either — the peer's FIN hasn't arrived when poll() runs), and yet neither retry block is entered and the request succeeds anyway. It passes with both retry blocks compiled out, and with the probe compiled out.

Whatever recovers it, it is not those two, and they stay uncovered. Worth knowing before someone reads that test as covering the retry — finding it out took making each change and running it.

Verification: 640/640 mongoc, 590/590 corDB.

Needs corNgsild#12 (the matcher half) and corNgsild#13 (hops/joinLevel)
merged first - the matrix's Relationship rows and url_param_join's expects
are pinned against both.

RELATIONSHIP ORDERING (§ 7.2.3.3)

The instance object is $$kv.v and carries its own `type`, so excluding a
Relationship is one more conjunct. Two placements, and only one is right:

  - for the ordering operators, INSIDE the per-instance predicate;
  - for !~=, OUTSIDE the negation. A guard inside the predicate that !~=
    negates turns "this target is excluded" into "this target matches" -
    the third time today that trap has come up.

The string guard beside it had to widen at the same time, from "the target
is a string" to "the target is a string OR an array with a string in it",
or `A!~=urn` dropped ["aaa","mid","zzz"] on mongoc alone.

LEGACY itemType RETIRED FROM BOTH CONSUMERS

mongocEntityQuery and troeQTreeToSql now read itemTypeV directly. The
fallback they carried was already dead: parseValueList is the only place
that builds an LdQValueList and it always allocates the per-item types.
corNgsild can drop the field once this merges.

TWO corRest TESTS - and only one of them covers what it looks like

  distop_query_big_response       a forwarded query whose response outgrows
                                  the engine's 8 KB read buffer. VERIFIED to
                                  reach the doubling: instrumented, fires once.

  distop_query_pooled_connection_reuse
                                  a forwarded query survives the Context
                                  Source restarting, pooled socket and all.

⚠️ The second does NOT cover the `fromPool && !retried` retry blocks, and
its header says so. Instrumenting proved it: the second query DOES take the
pooled socket (POOLGET hits, so the liveness probe does not catch the death
either - the peer's FIN has not arrived when poll() runs), and yet neither
retry block is entered and the request succeeds anyway. It passes with both
retry blocks compiled out, and with the probe compiled out. Whatever
recovers it, it is not those two, and they stay uncovered.

640/640 mongoc, 590/590 corDB.
@kzangeli
kzangeli merged commit 6ea3548 into main Sep 4, 2026
7 checks passed
@kzangeli
kzangeli deleted the q-broker-half-relationship-and-correst branch September 4, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant