Skip to content

fix(cpp): propagate table read failures without silent data loss - #970

Open
ColinLeeo wants to merge 2 commits into
apache:developfrom
ColinLeeo:colin/fix-table-read-error-propagation
Open

ColinLeeo wants to merge 2 commits into
apache:developfrom
ColinLeeo:colin/fix-table-read-error-propagation

Conversation

@ColinLeeo

Copy link
Copy Markdown
Contributor

Propagate metadata and device-index read errors through table queries and tag filters instead of returning empty or partial results or misleading errors. Preserve terminal result-set failures and reject unexpected short reads while allowing EOF-limited prefetches.

Use checked schema lookups in the C/Python bindings and release tag filters when query creation fails. Add fault-injection regression coverage for row and batch queries, tag filtering, and leaf/internal device indexes.

Validation: C++ 953 passed, 3 skipped; Python 356 passed, 1 skipped. Spotless, Black, and whitespace checks passed.

Propagate metadata and device-index read errors through table queries and tag filters instead of returning empty or partial results or misleading errors. Preserve terminal result-set failures and reject unexpected short reads while allowing EOF-limited prefetches.

Use checked schema lookups in the C/Python bindings and release tag filters when query creation fails. Add fault-injection regression coverage for row and batch queries, tag filtering, and leaf/internal device indexes.

Validation: C++ 953 passed, 3 skipped; Python 356 passed, 1 skipped. Spotless, Black, and whitespace checks passed.
Comment on lines 51 to 198
@@ -177,22 +192,25 @@ std::shared_ptr<ResultSetMetadata> TableResultSet::get_metadata() {
int TableResultSet::get_next_tsblock(common::TsBlock*& block) {
int ret = common::E_OK;
block = nullptr;
if (read_error_ != common::E_OK) {
return read_error_;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are quite a few state transitions here, so I'd prefer to refactor this logic. For example, I'd introduce an explicit state machine and model the read-state transitions separately for row-wise and batch reads.

Remove the legacy no-error table schema and tag factory entry points. Make table and timeseries schema lookups return allocated objects with ERRNO output parameters, including read failures instead of silently returning empty or partial schemas.

Update the C++ reader, CLI, examples, Python bindings, Go cgo bridge, and tests to the unified API. Add fault-injection coverage for all-timeseries schema reads.

Validation: C++ 953 passed, 3 skipped; Python 357 passed, 1 skipped; Go tests passed. Formatting and whitespace checks passed.
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