cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

filterResults should be evaluated when resuming objects #629

Closed SanderMertens closed 6 years ago

SanderMertens commented 6 years ago

When a mount policy enables filterResults, queries on the mount are filtered by corto (as opposed to forcing the mount to do the filtering). This can often be more performant than having the mount construct & evaluate a filter for every query, as filters can often be shared between mount queries.

When resuming data from a mount (using for example corto_lookup or corto_result) the mount_resume function does not take into account if filterResults has been enabled, and therefore fails if the mount returns multiple (unfiltered) results for an object specifying a single query.

When filterResults is enabled, mount_resume should check if the returned objects match the object it is trying to resume. This can be done cheaply with a single strcmp, as queries for a resume always relate to a single object and won't contain wildcard operators.

SanderMertens commented 6 years ago

Fixed in this commit: 7500bfe2c0e159085b6723a6e33da99eed27ed9e