-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cube+Cubestore - pre-aggregation only built for one tenant #9132
Comments
I would focus on these parts. If the pre-aggregation is not built, there should be an error message in the refresh worker logs. It should not just silently skip it. I would suggest that you experiment with this toy setup that you've created and see that refresh worker starts building the pre-agg for this tenant. And if it's not, what the error shown is. Also, if you can deploy this toy setup to Cube Cloud and see what happens there, you might get some insights as well. (I mean, there are tools for observing pre-aggregation builds there as well.) |
I replicated my production deployment with this stack: services:
cube_api:
restart: always
image: cubejs/cube:latest
ports:
- 4000:4000
- 15432:15432
env_file:
- .env.production
environment:
- CUBEJS_CUBESTORE_HOST=cubestore_router
volumes:
- .:/cube/conf
- ~/.aws:/root/.aws
depends_on:
- cube_refresh_worker
- cubestore_router
- cubestore_worker_1
- cubestore_worker_2
cube_refresh_worker:
restart: always
image: cubejs/cube:latest
env_file:
- .env.production
environment:
- CUBEJS_CUBESTORE_HOST=cubestore_router
- CUBEJS_REFRESH_WORKER=true
volumes:
- .:/cube/conf
- ~/.aws:/root/.aws
cubestore_router:
restart: always
image: cubejs/cubestore:arm64v8
platform: linux/arm64
env_file:
- .env.production
environment:
- CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
- CUBESTORE_REMOTE_DIR=/cube/data
- CUBESTORE_META_PORT=9999
- CUBESTORE_SERVER_NAME=cubestore_router:9999
volumes:
- .cubestore:/cube/data
- ~/.aws:/root/.aws
cubestore_worker_1:
restart: always
image: cubejs/cubestore:arm64v8
platform: linux/arm64
env_file:
- .env.production
environment:
- CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
- CUBESTORE_SERVER_NAME=cubestore_worker_1:10001
- CUBESTORE_WORKER_PORT=10001
- CUBESTORE_REMOTE_DIR=/cube/data
- CUBESTORE_META_ADDR=cubestore_router:9999
volumes:
- .cubestore:/cube/data
- ~/.aws:/root/.aws
depends_on:
- cubestore_router
cubestore_worker_2:
restart: always
image: cubejs/cubestore:arm64v8
platform: linux/arm64
env_file:
- .env.production
environment:
- CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
- CUBESTORE_SERVER_NAME=cubestore_worker_2:10002
- CUBESTORE_WORKER_PORT=10002
- CUBESTORE_REMOTE_DIR=/cube/data
- CUBESTORE_META_ADDR=cubestore_router:9999
volumes:
- .cubestore:/cube/data
- ~/.aws:/root/.aws
depends_on:
- cubestore_router Based on the https://cube.dev/docs/product/deployment/core one but adjusting for AWS Athena as well as removing the export bucket. With this setup I was able to reproduce the error locally. Obviously, my real data model is larger than what I showed in my original comment. I knew one of my cubes was technically invalid for some tenants, as it uses columns that weren't present in all of their schemas. This has happened for a while and wasn't affecting this pre-aggregation. Now, it seems that if I remove the pre-aggregation that causes the error, this pre-aggregation is built. For now I'll move to conditionally including the cube depending on the tenant, as it is indeed better than having the error happening all the time. But I am still confused why it builds some pre-aggregations, but fails to build this one, because of the error in the other aggregation. Is it doing the aggregations in sequence and stops when it fails one? Is folder hierarchy at play here, because it does all the pre-aggregations in my top level |
Describe the bug
I am working on a production deployment of Cube+Cubestore with multi-tenancy. I use pre-aggregations in some models, which are working fine. However, one specific pre-aggregation is currently only being built for one tenant, which causes other tenant's queries that hit it to fail, with the API claiming that it can't find the expected pre-aggregation table:
I can't seem to figure out the reason for this. Looking at
cubestore
logs, I see the trail of building all the other pre-aggregations for all tenants, but the specific one I am talking about is never uploaded for the tenants in question. Cube refresh workers also do not show any errors related to this pre-aggregation.The following things are making the problem here unclear to me:
preAggregationsSchema
andscheduledRefreshContexts
should be OK otherwise I would have no pre-aggregations (right?)I have tried:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Both tenants should have the pre-aggregation built.
Minimally reproducible Cube Schema
Version:
v1.1.7
Additional context
Here is my
cube.js
configuration file:The text was updated successfully, but these errors were encountered: