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

[compat] [controller] add a field largestUsedRTVersionNumber in store config #1512

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arjun4084346
Copy link
Contributor

@arjun4084346 arjun4084346 commented Feb 8, 2025

Adding a field largestUsedRTVersionNumber in store config, which will be used to create new RT topic name whenever needed in future work

When we delete and recreate a store, we do not want to use the same old real time topic name, because that might not have been fully cleaned up. We want to use a new name, and to create the new name, we need to know the previous name that was ever used. This config will help in finding this out.

Resolves #XXX

How was this PR tested?

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

@arjun4084346 arjun4084346 marked this pull request as draft February 8, 2025 02:23
@arjun4084346 arjun4084346 force-pushed the rtnamechange branch 3 times, most recently from 1e2c1f9 to e74aa24 Compare February 11, 2025 01:08
@arjun4084346 arjun4084346 changed the title Rtnamechange [compat] [controller] add a field largestUsedRTVersionNumber in store config Feb 11, 2025
@arjun4084346 arjun4084346 marked this pull request as ready for review February 11, 2025 04:23
Copy link
Collaborator

@sushantmane sushantmane left a comment

Choose a reason for hiding this comment

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

Thanks, @arjun4084346 . Please take a look at my comments and let me know if you have any questions.

return this.storeProperties.largestUsedRTVersionNumber;
}

@SuppressWarnings("unused") // Used by Serializer/De-serializer for storing to Zoo Keeper
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: there is no space in Zoo Keeper

@@ -314,7 +314,7 @@ subprojects {
doFirst {
def versionOverrides = [
// project(':internal:venice-common').file('src/main/resources/avro/StoreVersionState/v5', PathValidation.DIRECTORY)
project(':internal:venice-common').file('src/main/resources/avro/StoreMetaValue/v27', PathValidation.DIRECTORY),
// project(':internal:venice-common').file('src/main/resources/avro/StoreMetaValue/v27', PathValidation.DIRECTORY),
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete the comment?

@@ -1190,6 +1190,11 @@ public VersionResponse getStoreLargestUsedVersion(String clusterName, String sto
return request(ControllerRoute.GET_STORE_LARGEST_USED_VERSION, params, VersionResponse.class);
}

public VersionResponse getStoreLargestUsedRTVersion(String clusterName, String storeName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need separate API for this if the route (GET_STORE_LARGEST_USED_VERSION) is the same as that of getStoreLargestUsedVersion?

+ store.getName() + ", it's smaller than one found in graveyard: " + largestUsedVersionNumber;
LOGGER.error(errorMsg);
throw new VeniceException(errorMsg);
if (largestUsedRTVersionNumber > store.getLargestUsedRTVersionNumber()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this check for RT during store migration? It doesn't make sense to me based on the above comments. Am I missing something?

@@ -156,7 +204,7 @@ public List<String> listStoreNamesFromGraveyard(String clusterName) {
* @return Matching store from each venice. Normally contains one element.
* If the store existed in some other cluster before, there will be more than one element in the return value.
*/
private List<Store> getStoreFromAllClusters(String storeName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feel free to add com.linkedin.venice.annotation.VisibleForTesting annotation if visibility is changed for unit testing only

Comment on lines +98 to +99
if (deletedStore.getLargestUsedRTVersionNumber() > largestUsedRTVersionNumber) {
largestUsedRTVersionNumber = deletedStore.getLargestUsedRTVersionNumber();
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be replaces with Math.max like one usage somewhere below in this PR

}

@Test
void testStoreWithValidSystemStoreAttributes() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add one more test with DVC or meta system store

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need new test class? Can we use one of the existing class? Or we can consolidate all E2E tests related to RT repartitioning in one test class.


for (ControllerClient controllerClient: childControllerClients) {
Assert.assertEquals(controllerClient.getStore(storeName).getStore().getCurrentVersion(), 1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the validation for largest used RT version?

LOGGER.info(
"Found store: {} in the store graveyard. Will initialize the RT version to {}.",
storeName,
largestUsedStoreVersion);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should log largestUsedRTStoreVersion and not largestUsedStoreVersion

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

Successfully merging this pull request may close these issues.

2 participants