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

Redis sink flushes only rows that have more recent eventTimestamp #913

Merged
merged 11 commits into from
Aug 1, 2020

Conversation

pyalex
Copy link
Collaborator

@pyalex pyalex commented Aug 1, 2020

What this PR does / why we need it:

Since we keep only one row per entity in Redis storage previously it was unpredictable which row will be written, especially in batch ingestion. In this PR we read existing value from redis first to compare eventTimestamps and only if row from stream has more recent eventTimestamp it will be written to store. This guarantees that more recent row won't be overwritten with older value. Now redis will have the latest value for entity.

Also, I refactored tests for redis sink to remove duplicated parts of code and use @Parametrized tests instead.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Redis sink has now more predictable order of writes. Value is being overwritten only by more recent row from stream.

@pyalex
Copy link
Collaborator Author

pyalex commented Aug 1, 2020

/retest

@pyalex pyalex added the kind/feature New feature or request label Aug 1, 2020
@pyalex pyalex changed the title [WIP] Redis sink in IngestionJob flushes only most recent data Redis sink flushes only rows that have more recent eventTimestamp Aug 1, 2020
@pyalex
Copy link
Collaborator Author

pyalex commented Aug 1, 2020

/test test-end-to-end

* @param <Input>
* @param <Output>
*/
public class BatchDoFnWithRedis<Input, Output> extends DoFn<Input, Output> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There seems to be only one extension of this base class (RedisCustomIO.WriteDoFn). Is this base class necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just wanted to separate redis wrapper code from business logic

@pyalex
Copy link
Collaborator Author

pyalex commented Aug 1, 2020

/test test-end-to-end

@pyalex
Copy link
Collaborator Author

pyalex commented Aug 1, 2020

/test test-end-to-end-batch

@woop
Copy link
Member

woop commented Aug 1, 2020

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pyalex, woop

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@feast-ci-bot feast-ci-bot merged commit d3295a2 into feast-dev:master Aug 1, 2020
@mrzzy mrzzy mentioned this pull request Aug 2, 2020
pyalex pushed a commit that referenced this pull request Aug 2, 2020
* redis sink read then write

* fix load tests

* e2e

* fix

* specify feature ref

* move test up in order

* set project default

* some docs

* reorder e2e tests

* reorder e2e tests

* reorder e2e tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants