alpass163 opened a new pull request, #18874:
URL: https://github.com/apache/iotdb/pull/18874
## Motivation
A tree-to-table view created with `auto_sync_schema = true` must keep its
table schema
aligned with the tree timeseries its `__tree_path_pattern` covers.
Measurements created
after the view existed stayed invisible to the table model until the table
was altered by
hand.
## Design
**DataNode — detection.** `TreeToTableViewCache` indexes each view by its
path prefix.
`TriggerAddViewColumnVisitor` runs from `SchemaExecutionVisitor` ahead of
every schema-region
write plan: `create timeseries`, aligned/multi creation, the internal
create nodes behind
`insert into`, template activation and template extension. It resolves the
written devices
against the index and sends the covering views with their new measurements
to ConfigNode via
the new `updateTree2TableViews` RPC. The trigger is best-effort: failures
are logged and never
fail the write.
**ConfigNode — column addition.** `AddViewColumnProcedure` adds the
columns, serialized per
table through `checkDuplicateTableTask`. Requests are deduplicated by
queryId, so the replicas
replaying one log entry yield a single operation; overlapping ones are
retried within a
bounded deadline.
**Index maintenance.** The index is mutated only at commit-release, always
through the HA
propagator, so a rollback (`CREATE OR REPLACE`) restores the previous view
registration
instead of leaving a stale entry.
**Catch-up.** Creating a view, turning `auto_sync_schema` on for an
existing one, and extending
a schema template each scan the timeseries that already exist and add
whatever columns are
missing, so a view never lags behind the tree model.
--
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]