matrixorigin / matrixorigin/matrixone

[Bug]: MongoDB conversion failures do not update conversion error metric

Open
#28,341 2 comments 0 reactions 1 assignee Claimed by @Ariznawlll View on GitHub
ai-easy kind/bug needs-triage
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

## Summary

MongoDB external-table conversion failures are returned to the client, but `mo_mongodb_conversion_errors_total` does not increase. This makes the conversion-error metric unable to reflect a real strict BSON-to-MatrixOne conversion failure.

## Environment

- Namespace: `mo-search-commit-4fdb9e916-20260907` on TKE host 129
- MatrixOne image: `commit-4fdb9e916`
- Topology: 3 CN / 1 DN / 3 Log / 2 Proxy
- MongoDB: 8.0.12, 3-member `rs0`
- Fixture: `mongodb_cov_4fdb.events_aggregate`

## Reproduction

```sql
SELECT device_id,event_count,avg_measurement
FROM mongodb_cov_4fdb.events_aggregate
WHERE __mo_query = '{"pipeline":[{"$project":{"_id":0,"device_id":1,"event_count":{"$literal":"bad"},"avg_measurement":{"$literal":1.5}}}]}';
```

The query was executed three times and each run returned:

```text
ERROR 20301 (HY000): invalid input: MongoDB value at path event_count cannot be converted to BIGINT
```

After the failures, all CN metric endpoints showed:

```text
mo_mongodb_conversion_errors_total 0
mo_mongodb_cursor_events_total{event="open"} = mo_mongodb_cursor_events_total{event="close"}
mo_mongodb_pool_checked_out_connections 0
```

## Expected result

Please increment the conversion-error metric for business BSON conversion failures, or explicitly document that this metric only counts tolerated/limited conversion errors and provide a separate metric for strict conversion failures. The metric should remain bounded and must not expose query values or credentials.

## Safety checks

- Cursor open/close counts matched and the checked-out connection gauge returned to zero.
- External-table baseline remained `COUNT(*) = 5`, `SUM(measurement) = 74`.
- No MongoDB source data was modified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.