metrico / qryn

⭐️ All-in-One Polyglot Observability with OLAP Storage for Logs, Metrics, Traces & Profiles. Drop-in Grafana Cloud replacement compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog and beyond :rocket:
https://qryn.dev
GNU Affero General Public License v3.0
1.24k stars 68 forks source link

When creating tables, create them with a storage policy if env var is set #397

Closed danjenkins closed 8 months ago

danjenkins commented 11 months ago

If you don't create the tables with the right policy to start with, changing them later becomes more difficult.

2023.11.30 14:07:14.189999 [ 43 ] {dca12b4b-2a04-4259-a3f7-50f4cfdfc862} <Error> DynamicQueryHandler: Code: 36. DB::Exception: New storage policy externalshall contain volumes of the old storage policydefault. (BAD_ARGUMENTS), Stack trace (when copying this message, always include the lines below):
{"level":20,"time":1701352745340,"pid":26,"hostname":"qryn-f7cb56bd9-xkgvh","name":"qryn","msg":"Altering storage policy: external"}
ALTER TABLE time_series  MODIFY SETTING storage_policy='external'
{"level":50,"time":1701352745363,"pid":26,"hostname":"qryn-f7cb56bd9-xkgvh","name":"qryn","err":"Error: Request failed with status code 400\nResponse: [400] undefined\nError: Request failed with status code 400\n    at createError (/app/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/app/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/app/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:526:35)\n    at endReadableNT (node:internal/streams/readable:1589:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","msg":"Error starting qryn"}
akvlad commented 11 months ago

@danjenkins Do you prefer all the tables to have the storage policy or just the heaviest ones?

danjenkins commented 11 months ago

@akvlad I think If I've passed in a STORAGE_POLICY env var I'd expect them all to have that policy

akvlad commented 11 months ago

@danjenkins should be fixed in v3.0.21 feel free to recheck.

lmangani commented 10 months ago

@danjenkins any chance to confirm if this solves your challenge?

danjenkins commented 10 months ago

Yes I'll confirm tomorrow!

gaby commented 8 months ago

@danjenkins is it fixed?

danjenkins commented 8 months ago

Yup! Sorry forgot to report back

lmangani commented 8 months ago

Closing as completed