v2.1.7#289
Merged
Merged
Conversation
… partition
Three reported follow-up bugs:
1. `within` in a WHERE clause only accepted a constant vector literal.
`(within sn (list lo hi))` / `(enlist lo hi)` — the natural way to use
variable bounds — fell through to a domain error. The DAG lowering now
also decomposes a 2-element `(list …)` / `(enlist …)` constructor at the
AST level, compiling each bound expression individually, so runtime /
variable bounds work. (`[lo hi]` stays a symbol-vector literal by design.)
2. `first`/`last` over an I64/F64 vector return a single-use lazy handle
(AGG_VEC_VIA_DAG → ray_lazy_wrap). A lazy bound to a variable and read
twice broke on the second read with `nyi`, because materialization
consumes the deferred graph — e.g. `(let v (first xs)) (if (> v 0) v 0)`
inside a compiled lambda. The interpreter's ray_let_fn already
materializes at bind; the compiled paths did not. Fix, mirroring that
invariant ("a bound local holds a concrete value"):
- compiled `let` emits a new OP_FORCE before storing, materializing
the value before it is duplicated/aliased;
- OP_LOADENV materializes a lazy local on first read and stores the
concrete back, covering lambda PARAMETERS (not forced at bind).
first/last semantics (incl. null-skipping) are unchanged.
3. `.db.parted.tables` listed the table names from the FIRST (oldest)
partition, so a table added in a later partition was invisible. It now
reads the LAST (most recent) partition — partition dirs sort ascending —
and guards against an empty partition set.
Tests: where_within (list/enlist variable bounds), agg/first & agg/last
(lazy reuse via let and via lambda param), db_get (last-partition table
discovery).
…v4 server `(.ipc.open "localhost:PORT")` failed with "connection refused" while `127.0.0.1:PORT` worked. ray_sock_connect only attempted the FIRST getaddrinfo result; `localhost` commonly resolves to ::1 (IPv6) first, and the server binds IPv4-only (ray_sock_listen uses AF_INET), so the ::1 attempt is refused and the connect gave up instead of falling through to 127.0.0.1. Iterate over every resolved address, creating a socket per candidate and returning the first that connects (the standard getaddrinfo connect loop); the last failure's errno is preserved so a genuine refused/timeout still surfaces correctly. The per-address connect logic (timeout-bounded non-blocking or plain blocking) is factored into sock_connect_one. Test: ipc_open_timeout opens "localhost:19998" against the IPv4 server and round-trips a query.
…tions `(.db.parted.fill "db_root")` ensures every partition of a parted db has every table that appears in any partition: a partition missing a table gets an EMPTY copy whose schema is taken from the most recent partition that has it. This keeps select-across-partitions from failing on a partition where a table is absent (e.g. a table added partway through the db's life, or a partition written before that table existed). Returns a sorted SYM vector of the partition names that were filled (empty when nothing needed fixing, so a repeat call is a no-op). Registered RESTRICTED since it writes to disk. Implementation (src/store/part.c): factor the per-partition table-dir enumeration out of ray_parted_tables into collect_table_dirs; ray_parted_fill builds the union of table names across partitions, and for each table writes an empty clone (built from the template partition's schema via empty_table_like) into every partition lacking it, sharing the root .sym. Tests: db_parted_fill (fill, idempotency, empty-copy row counts, error paths); reserved_namespace updated for the new .db.parted entry. Docs: namespaces/db.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.