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

Notification API reject out of order notifications #232

Merged

Conversation

tzuan16
Copy link
Contributor

@tzuan16 tzuan16 commented Aug 29, 2024

Description

UPDATE/CREATE notifications will be rejected if the timestamp is older than the latest processed for the table.
DROP notifications won't be affected since messing up the order of DROPs is acceptable as they are idempotent.

Update the notification API spec to clarify that the API caller should ensure the correct order of timestamps for a sequence of notifications. Also added the description for 409 conflict error.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • BasePolarisCatalogTest::testUpdateNotificationRejectOutOfOrderTimestamp

Test Configuration:

  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue

@tzuan16 tzuan16 force-pushed the reject-out-of-order-notification branch from fd44b85 to 886bafc Compare August 29, 2024 22:17
Copy link
Contributor

@eric-maynard eric-maynard left a comment

Choose a reason for hiding this comment

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

LGTM with one comment.

I am a little concerned about clock skew across multiple senders with this approach though. Rather than timestamp, would it be possible for notification senders to use something like an ordering key, and potentially for them to obtain it from Polaris?

@tzuan16
Copy link
Contributor Author

tzuan16 commented Sep 5, 2024

I am a little concerned about clock skew across multiple senders with this approach though. Rather than timestamp, would it be possible for notification senders to use something like an ordering key, and potentially for them to obtain it from Polaris?

Discussed with Eric offline, we leave it to the notification sender to ensure the correct order of timestamps for a sequence of notifications. This is due to Polaris serving as the "external" catalog, where the single source of truth should come from the actual catalog that "owns" the table. We don't want the proprietary catalog to have to speak with Polaris first prior to sending the notification.

@RussellSpitzer
Copy link
Member

Thanks @eric-maynard and @tzuan16 , set to auto-merge on tests passing

@RussellSpitzer RussellSpitzer enabled auto-merge (squash) September 5, 2024 18:01
RussellSpitzer
RussellSpitzer previously approved these changes Sep 5, 2024
auto-merge was automatically disabled September 5, 2024 22:59

Head branch was pushed to by a user without write access

@RussellSpitzer RussellSpitzer enabled auto-merge (squash) September 6, 2024 14:17
@RussellSpitzer RussellSpitzer merged commit 96284a9 into apache:main Sep 6, 2024
6 checks passed
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.

3 participants