Skip to content
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

fix(mat-view-schedules): Fixes for scheduled materialized views #28701

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

phixMe
Copy link
Contributor

@phixMe phixMe commented Feb 14, 2025

Problem

Mostly trying to fix a production only weird update issue where the update isn't captured properly for the first sync interval.

Changes

  • Clean up loading states
  • Trying to fix bug

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Works the same locally, but hopefully fixes prod issue.

@phixMe phixMe changed the title fix(mat-view-schedules) Fixes for scheduled materialized views fix(mat-view-schedules): Fixes for scheduled materialized views Feb 14, 2025
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Size Change: -5 B (0%)

Total Size: 1.21 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.21 MB -5 B (0%)

compressed-size-action

@phixMe phixMe marked this pull request as ready for review February 14, 2025 20:16
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR addresses issues with materialized view scheduling in PostHog by making the following key changes:

  • Added loading state indicators to the InfoTab component in /frontend/src/scenes/data-warehouse/editor/OutputPaneTabs/InfoTab.tsx to improve UX during sync frequency updates
  • Wrapped sync frequency updates in a transaction block in /posthog/warehouse/api/saved_query.py to ensure atomic operations
  • Moved workflow sync operation outside the transaction block to prevent potential deadlocks
  • Added proper handling of 'never' sync frequency by explicitly setting sync_frequency_interval to None
  • Improved state management for the LemonSelect component to accurately reflect update status

The changes focus on fixing a production-specific issue where the first sync interval update wasn't being properly captured, while also enhancing the overall reliability of materialized view scheduling.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@phixMe phixMe requested a review from a team February 14, 2025 20:46
@phixMe phixMe merged commit b5b8e46 into master Feb 18, 2025
108 checks passed
@phixMe phixMe deleted the fix(mat-view-followup) branch February 18, 2025 18:08
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