Skip to content

fix(bamboohr): stop the field-history build running out of memory - #2506

Merged
aleksdotbar merged 1 commit into
release-2026.07.1from
claude/backport-2495-release-2026.07.1
Aug 13, 2026
Merged

fix(bamboohr): stop the field-history build running out of memory#2506
aleksdotbar merged 1 commit into
release-2026.07.1from
claude/backport-2495-release-2026.07.1

Conversation

@aleksdotbar

Copy link
Copy Markdown
Contributor

Backports #2495 to release-2026.07.1.

The employee field-level change log diffed two per-version maps and read both back after an ARRAY JOIN, so every key replicated the whole raw_data payload and a single block cost gigabytes — the server memory tracker stopped the build, failing the sync after extraction had already committed. Reshaped as spillable GROUP BY aggregation over a per-field timeline; output unchanged.

Cherry-picked clean from 3fbbc02 — both files are byte-identical to upstream. The release branch already carried the pre-#2495 fields_history.sql via the #2478 backport.

fields_history() is shared by 10 connectors (zoom, slack, jira, youtrack, outline, ms-entra, workday, active-directory, cursor, zulip-proxy), so their builds change the same way they did on main. Macro signature unchanged.

Not run here: dbt parse/build.

Refs #2491.

)

The employee field-level change log diffed two per-version maps and read
both back after an ARRAY JOIN, so every key replicated the whole payload
and a single block cost gigabytes. A build large enough to matter was
stopped by the server memory tracker, failing the sync after extraction
had already committed its records.

Shape it as GROUP BY aggregation over a per-field timeline instead.
Aggregation state spills to disk past max_bytes_before_external_group_by,
which the previous form could not do at all — ARRAY JOIN and window sort
state both stay resident. Peak memory now stays near flat as the snapshot
grows rather than tracking its size.

Output is unchanged, including the clear a field emits when a later
version stops carrying it.

No max_memory_usage on the model: a self-imposed cap converts a build the
server could still afford into a hard failure.

Closes #2491

Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 3fbbc02)
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f7806ef2-8b48-4991-aa8d-5a66ee9ff54b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aleksdotbar
aleksdotbar merged commit aa92997 into release-2026.07.1 Aug 13, 2026
22 checks passed
@aleksdotbar
aleksdotbar deleted the claude/backport-2495-release-2026.07.1 branch August 13, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants