Magdalena Paszko
02/20/2024, 10:03 AMThis run exceeded your account's run memory limits.
The error is returned at the elementary's on-run-end hook. dbt support, after having inspected logs, tells me that the peak memory usage occurs at this stage (that is in a successful run):
2024-01-22 00:02:13.484827 (MainThread): 00:02:13 On master: /* {"app": "dbt", "dbt_version": "1.7.5", "profile_name": "user", "target_name": "prod", "connection_name": "master"} */
select artifacts_model, metadata_hash from "CUSTOM"."DBT_METADATA"."DBT_ARTIFACTS_HASHES"
order by metadata_hash
2024-01-22 00:02:19.299083 (MainThread): 00:02:19 SQL status: SUCCESS 9460703 in 6.0 seconds
Is it necessary for elementary to retrieve all results from DBT_ARTIFACTS_HASHES table which is currently >9M rows and growing? Can this behavior be disabled?Tom Klimovski
03/06/2024, 5:05 AMIdan Shavit
03/06/2024, 6:32 AMcache_artifacts to false. This should disable the use of DBT_ARTIFACTS_HASHESIdan Shavit
03/06/2024, 6:32 AMTom Klimovski
03/06/2024, 6:34 AMversion: 0.10.0 😐Idan Shavit
03/06/2024, 6:37 AMTom Klimovski
03/06/2024, 6:37 AMcache_artifacts to false to help unblock the devs. thanks @Idan ShavitIdan Shavit
03/06/2024, 6:38 AMTom Klimovski
03/07/2024, 9:18 AM{"data": {"conn_name": "master", "sql": "/* {\"app\": \"dbt\", \"dbt_version\": \"1.4.7\", \"profile_name\": \"\", \"target_name\": \"main\", \"connection_name\": \"master\"} */\n\n \n select artifacts_model, metadata_hash from `dbt_artifacts_hashes`\n order by metadata_hash\n \n "}, "info": {"category": "", "code": "E016", "extra": {}, "invocation_id": "110fa9cd0e64", "level": "debug", "msg": "On master: /* {\"app\": \"dbt\", \"dbt_version\": \"1.4.7\", \"profile_name\": \"\", \"target_name\": \"main\", \"connection_name\": \"master\"} */\n\n \n select artifacts_model, metadata_hash from `dbt_artifacts_hashes`\n order by metadata_hash\n \n ", "name": "SQLQuery", "pid": 65, "thread": "MainThread", "ts": "2024-03-07T03:39:07.479813Z"}}
{"data": {"args": [], "base_msg": "<https://console.cloud.google.com/bigquery?&page=queryresults>", "name": "BigQuery", "node_info": {"materialized": "view", "meta": {}, "node_finished_at": null, "node_name": "elementary-on-run-end-0", "node_path": "hooks/elementary-on-run-end-0.sql", "node_started_at": "2024-03-07T03:39:07.194317", "node_status": "started", "resource_type": "operation", "unique_id": "operation.elementary.elementary-on-run-end-0"}}, "info": {"category": "", "code": "E001", "extra": {}, "invocation_id": "110fa9cd0e64", "level": "debug", "msg": "BigQuery adapter: <https://console.cloud.google.com/bigquery?5&page=queryresults>", "name": "AdapterEventDebug", "pid": 65, "thread": "MainThread", "ts": "2024-03-07T03:43:55.284414Z"}}Tom Klimovski
03/07/2024, 9:19 AM{"data": {"hook_type": "on-run-end", "num_hooks": 1}, "info": {"category": "", "code": "E046", "extra": {}, "invocation_id": "31f287b9-73f9
-4cc9-85d2-a9df871797fb", "level": "info", "msg": "Running 1 on-run-end hook", "name": "HooksRunning", "pid": 66, "thread": "MainThread", "
ts": "2024-03-07T06:38:49.377136Z"}}
Killed
/usr/local/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 2 leaked semaphore obj
ects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d 'Tom Klimovski
03/07/2024, 9:20 AMMagdalena Paszko
03/07/2024, 11:25 AMDBT_ARTIFACTS_HASHES view has accumulated rows accordingly and this caused the memory explosion. So I just customized the view definition to only return artefacts from the most recent invocation.
Still - I would like to understand what this DBT_ARTIFACTS_HASHES view does but I find no information in Elementary documentation. What is its role in collecting the run results?