influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.71k stars 3.54k forks source link

feat: v3 write API and line protocol validation #25048

Closed hiltontj closed 3 months ago

hiltontj commented 3 months ago

Closes #25033

Summary

This PR leverages a set of changes introduced experimentally into influxdb3_core to enable the v3 line protocol write API proposed in https://github.com/influxdata/influxdb/issues/24979.

You can see the result in an end-to-end test here, that performs a write to the /api/v3/write API, and then performs a set of queries to verify that the data can be queried, and that the new line protocol is validated for correctness in the written series key.

Detailed Changes

Extend the Catalog to support tables with series key

After https://github.com/influxdata/influxdb/issues/25031, the TableDefinition in the catalog is just a wrapper around the Schema type from the core schema crate. Therefore, a lot of the following functionality stems from the changes made to that type to support the series key in influxdb3_core.

Split the write path to enable validation and buffering of v1 and v3 writes

The code that parsed and validated incoming writes was previously written as a series of nested function calls. This PR refactored that code by:

Add a new /api/v3/write API

This is the API that leverages the new write path, and can be used to perform writes using the new write protocol. It accepts the same parameters as the existing /api/v3/write_lp API.

hiltontj commented 3 months ago

Closed, see #25066