-
Notifications
You must be signed in to change notification settings - Fork 108
[controller] [server] extend rt versioning to system stores #2264
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,7 @@ | |||||||||||||||||||||||||
| import com.linkedin.venice.meta.Store; | ||||||||||||||||||||||||||
| import com.linkedin.venice.meta.StoreDataChangedListener; | ||||||||||||||||||||||||||
| import com.linkedin.venice.meta.SubscriptionBasedReadOnlyStoreRepository; | ||||||||||||||||||||||||||
| import com.linkedin.venice.meta.SystemStoreAttributes; | ||||||||||||||||||||||||||
| import com.linkedin.venice.meta.Version; | ||||||||||||||||||||||||||
| import com.linkedin.venice.pubsub.api.PubSubPosition; | ||||||||||||||||||||||||||
| import com.linkedin.venice.pushmonitor.ExecutionStatus; | ||||||||||||||||||||||||||
|
|
@@ -308,7 +309,8 @@ public DaVinciBackend( | |||||||||||||||||||||||||
| ingestionService.getVeniceWriterFactory(), | ||||||||||||||||||||||||||
| instanceName, | ||||||||||||||||||||||||||
| valueSchemaEntry, | ||||||||||||||||||||||||||
| updateSchemaEntry); | ||||||||||||||||||||||||||
| updateSchemaEntry, | ||||||||||||||||||||||||||
| (this::getStore)); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ingestionService.start(); | ||||||||||||||||||||||||||
|
|
@@ -558,6 +560,23 @@ public SubscriptionBasedReadOnlyStoreRepository getStoreRepository() { | |||||||||||||||||||||||||
| return storeRepository; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| /** | |
| * Resolves and returns the store object for the given store name. | |
| * <p> | |
| * For system stores, this returns the {@link SystemStoreAttributes} from the parent user store. | |
| * For regular stores, this returns the {@link Store} object directly. | |
| * If the store is not found, returns {@code null}. | |
| * | |
| * @param storeName the name of the store to retrieve | |
| * @return {@link Store} for regular stores, {@link SystemStoreAttributes} for system stores, or {@code null} if not found | |
| */ |
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.
This logic scattered in here is not great IMO.
I think the main purpose to extract push status store's RT version right? Then can we just instead pass ReadOnlyStoreRepository interface into the the PushStatusStoreWriter constructor, and extract the user store object -> extract system store info -> get largest RT version when preparing VW? I think this will make the logic hidden inside the corresponding object.
Same comment goes to MetaStoreWriter.
Copilot
AI
Nov 13, 2025
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.
Missing null check before calling getSystemStores(). If userStore is null, this will throw a NullPointerException. Add a null check:
if (userStore == null) {
return null;
}
Map<String, SystemStoreAttributes> systemStores = userStore.getSystemStores();| Store userStore = storeRepository.getStore(userStoreName); | |
| Store userStore = storeRepository.getStore(userStoreName); | |
| if (userStore == null) { | |
| return null; | |
| } |
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.
The method signature uses
Objectas the return type which is too generic and loses type safety. Based on the implementation, it can return eitherStoreorSystemStoreAttributes(or null). Consider using a more specific return type or union type approach. For example:Storeand castSystemStoreAttributesappropriately where usedObjectis necessaryThis makes the API unclear for callers who need to know what type to expect and cast to.