-
Notifications
You must be signed in to change notification settings - Fork 89
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
[da-vinci][common] DVC consumer for materialized view (batch only) #1466
Conversation
42b48dd
to
e546936
Compare
Hi @xunyin8
Here is one idea in my mind:
If we build such capability, the change in DVRT or CDC will be fairly straightforward. WDYT? |
This makes sense, I was hoping to be able to keep the adapting layer only in |
6460bcc
to
a7ff6e2
Compare
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.
Left some more comments about the adapting layer?
BTW, can you remind me of the place where we can guarantee the uniqueness of view names?
One way we can do is to make sure the store name doesn't contain the special separator being used to concatenate the store name and view name.
clients/da-vinci-client/src/main/java/com/linkedin/davinci/DaVinciBackend.java
Outdated
Show resolved
Hide resolved
clients/da-vinci-client/src/main/java/com/linkedin/davinci/DaVinciBackend.java
Outdated
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Outdated
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/com/linkedin/venice/helix/HelixReadOnlyStoreViewConfigRepositoryAdapter.java
Show resolved
Hide resolved
internal/venice-common/src/main/java/com/linkedin/venice/meta/ReadOnlyStoreView.java
Outdated
Show resolved
Hide resolved
internal/venice-common/src/main/java/com/linkedin/venice/meta/ReadOnlyStoreView.java
Outdated
Show resolved
Hide resolved
internal/venice-common/src/main/java/com/linkedin/venice/views/VeniceView.java
Outdated
Show resolved
Hide resolved
Currently we don't check uniqueness of view names across different stores and I think that's fine. The way we make sure view store names can be processed is with added check to ensure store names and view names do not contain view separator:
and
|
0968db3
to
c8ff803
Compare
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/store/view/MaterializedViewWriter.java
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.
Code change looks good overall and left some more comments.
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Outdated
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Outdated
Show resolved
Hide resolved
...lient/src/main/java/com/linkedin/davinci/repository/NativeMetadataRepositoryViewAdapter.java
Outdated
Show resolved
Hide resolved
...-common/src/main/java/com/linkedin/venice/serialization/KeyWithChunkingSuffixSerializer.java
Show resolved
Hide resolved
internal/venice-common/src/main/java/com/linkedin/venice/views/VeniceView.java
Show resolved
Hide resolved
Limiting the change to support batch only materialized view to keep the PR small. Hybrid DVC consumer support and related features such as heartbeat will be added in a separate PR 1. New DaVinciClientFactory APIs for creating DVC for a given view. 2. Defined a new "storeName" rule for views to be used for metrics reporting and shared DVC client. See VeniceView.getStoreAndViewName for details. Trying to reuse much of the existing DVC code and structure while providing the support for users to subscribe to the original store and different views of the same store. 3. Introduced ReadOnlyMaterializedViewVersion and StoreViewBackend abstractions to minimize the code change needed for DVC to understand and work with views. ReadOnlyMaterializedViewVersion will provide view sepcific properties for a ReadOnlyVersion and StoreViewBackend will provide view specific properties for a StoreBackend.
Taking the suggestion of adding adapter layer in the common repositories instead of inserting it in StoreBackend and leaking in DVC client related classes.
c8ff803
to
40c5489
Compare
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.
Thanks!
[da-vinci][common] DVC consumer for materialized view (batch only)
Limiting the change to support batch only materialized view to keep the PR small. Hybrid DVC consumer support and related features such as heartbeat will be added in a separate PR
New DaVinciClientFactory APIs for creating DVC for a given view.
Defined a new "storeName" rule for views to be used for metrics reporting and DVC client. See VeniceView.getViewStoreName for details.
Introduced NativeMetadataRepositoryViewAdapter and HelixReadOnlyStoreViewConfigRepositoryAdapter to provide read-only interface to access various store metadata for both regular Venice stores and store views with the VeniceView.getViewStoreName.
There is some issue with chunking support on the read path. When chunking is enabled the view topic keys are doubly wrapped by
serializeNonChunkedKey
. This is because during NR pass-through mode the view writer is essentially trying to chunk the chunk. The tactical fix now is to unwrap the key with chunked suffix bytes appended and pass it to the view writer to be wrapped again and sent to the correct partition. This only works with non-large messages. I.e. chunking is enabled but nothing is actually getting chunked. Large messages will require a proper fix.How was this PR tested?
Unit tests and integration test
Does this PR introduce any user-facing changes?