-
Notifications
You must be signed in to change notification settings - Fork 102
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
Notification API reject out of order notifications #232
Conversation
97c9111
to
fd44b85
Compare
fd44b85
to
886bafc
Compare
polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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?
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. |
polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogTest.java
Show resolved
Hide resolved
Thanks @eric-maynard and @tzuan16 , set to auto-merge on tests passing |
Head branch was pushed to by a user without write access
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.
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
Test Configuration:
Checklist:
Please delete options that are not relevant.