Skip to content

Refactor offloading watermark and add watermark in metrics collection job #1074

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

Conversation

leo-marble
Copy link
Contributor

@leo-marble leo-marble commented Jul 3, 2025

This PR modifies the offloading_watermark table to be renamed to watermark. This change allows us to move away from the specific offloading use case and makes the table more generic.
Additionally, this PR introduces the concept of watermarking in the metric collection system to provide a reference for the lower bound on dates. The param attribute allows adding extra parameters based on the type of watermark if the existing fields are insufficient. I introduce the notion of watermark type

I have ensured that the same fields as in the offloading table are retained, although some field names have been changed for clarity and consistency.

The migration process is done in two steps:

Create the new watermark table.
Migrate the data from the offloading_watermark table to the new watermark table.
Delete the old offloading_watermark table.

During the migration, the table is locked to prevent any access and ensure data integrity.

Additionally, this PR introduces the concept of watermarking in the metric collection system to provide a reference for the lower bound on dates.

…te related methods for improved clarity and consistency
Copy link

linear bot commented Jul 3, 2025

@leo-marble leo-marble marked this pull request as draft July 3, 2025 15:29
@leo-marble leo-marble force-pushed the mar-1132-refactor-the-offloading_watermark branch 2 times, most recently from b0f8ece to 9ea9d5c Compare July 3, 2025 15:46
@leo-marble leo-marble self-assigned this Jul 3, 2025
@leo-marble leo-marble force-pushed the mar-1132-refactor-the-offloading_watermark branch from 9ea9d5c to 348a092 Compare July 3, 2025 15:53
@leo-marble leo-marble force-pushed the mar-1132-refactor-the-offloading_watermark branch from 348a092 to fe4ef00 Compare July 3, 2025 16:20
}
}

// HELP: Not sure about raising the error here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know how to deal with the error

Copy link
Contributor

Choose a reason for hiding this comment

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

I think returning an error is correct. it would happen if the function was passed a global watermark instead of a decision rules one. Maybe we can clarify the error to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix it in #1071 after rebase

@leo-marble leo-marble marked this pull request as ready for review July 3, 2025 16:43
Copy link
Contributor

@apognu apognu left a comment

Choose a reason for hiding this comment

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

Just left a response to one of your question. Let's do that and merge into the other branch, so we can review it fully functional!

CreatedAt time.Time
UpdatedAt time.Time
Params *json.RawMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

json.RawMessage is a []byte underneath, so it can already be nil. I don't think we need the extra indirection here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, thanks :)

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove the pointer in #1071 after rebase.
Thanks

@leo-marble leo-marble merged commit 554b18b into mar-1129-define-the-collectdata-logic Jul 4, 2025
1 check passed
@leo-marble leo-marble deleted the mar-1132-refactor-the-offloading_watermark branch July 4, 2025 07:48
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