[controller][vpj][dvc] Use isFlinkVeniceViewsEnabled flag to block unnecessary write to view topic #2369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement
When a store is marked as
isFlinkVeniceViewsEnabled=true, controller should only create the view topic and broadcast START_OF_PUSH.Currently, when there is a push job for a store, the server will ingest data into views topics, and controller will send out END_OF_PUSH and VERSION_SWAP messages.
In Flink-based views, data records and control messages (EOP/VS) will be populated through Flink job to ensure the correctness for the CM.
Solution
To block the unnecessary write to view topic, we will use store properties
isFlinkVeniceViewsEnabledconfig, which is introduced in #2357 and #2356.There are two main places we will block:
clients/venice-push-job/src/main/java/com/linkedin/venice/hadoop/task/datawriter/AbstractPartitionWriter.java.In this writer, we use the flag through a push job config that is only active when there is materialized view configured for the store. This push config will stop
CompositeVeniceWritercreation, which will write to view topic before writing to version topic.LeaderFollowerStoreIngestionTaskIn this SIT, we will not create viewWriter, hence, will not
queueUpVersionTopicWritesWithViewWriters. This prevents data write in native replication process.Code changes
Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
Does this PR introduce any user-facing or breaking changes?