-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix(struct-prop): fix unintended struct prop ES mutation #11751
Merged
david-leifker
merged 1 commit into
datahub-project:master
from
david-leifker:fix-struct-props-1
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...in/java/com/linkedin/datahub/upgrade/config/restoreindices/PropertyDefinitionsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.linkedin.datahub.upgrade.config.restoreindices; | ||
|
||
import com.linkedin.datahub.upgrade.config.SystemUpdateCondition; | ||
import com.linkedin.datahub.upgrade.system.NonBlockingSystemUpgrade; | ||
import com.linkedin.datahub.upgrade.system.restoreindices.structuredproperties.PropertyDefinitions; | ||
import com.linkedin.metadata.entity.AspectDao; | ||
import com.linkedin.metadata.entity.EntityService; | ||
import io.datahubproject.metadata.context.OperationContext; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@Conditional(SystemUpdateCondition.NonBlockingSystemUpdateCondition.class) | ||
public class PropertyDefinitionsConfig { | ||
|
||
@Bean | ||
public NonBlockingSystemUpgrade propertyDefinitions( | ||
final OperationContext opContext, | ||
final EntityService<?> entityService, | ||
final AspectDao aspectDao, | ||
@Value("${systemUpdate.propertyDefinitions.enabled}") final boolean enabled, | ||
@Value("${systemUpdate.propertyDefinitions.batchSize}") final Integer batchSize, | ||
@Value("${systemUpdate.propertyDefinitions.delayMs}") final Integer delayMs, | ||
@Value("${systemUpdate.propertyDefinitions.limit}") final Integer limit) { | ||
return new PropertyDefinitions( | ||
opContext, entityService, aspectDao, enabled, batchSize, delayMs, limit); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...onfig/ReindexDomainDescriptionConfig.java → ...dices/ReindexDomainDescriptionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...raph/ReindexDataJobViaNodesCLLConfig.java → ...raph/ReindexDataJobViaNodesCLLConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...config/graph/ReindexEdgeStatusConfig.java → ...ndices/graph/ReindexEdgeStatusConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...description/ReindexDomainDescription.java → ...description/ReindexDomainDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ription/ReindexDomainDescriptionStep.java → ...ription/ReindexDomainDescriptionStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m/graph/edgestatus/ReindexEdgeStatus.java → ...s/graph/edgestatus/ReindexEdgeStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...estatus/ReindexReindexEdgeStatusStep.java → ...estatus/ReindexReindexEdgeStatusStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...h/vianodes/ReindexDataJobViaNodesCLL.java → ...h/vianodes/ReindexDataJobViaNodesCLL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...anodes/ReindexDataJobViaNodesCLLStep.java → ...anodes/ReindexDataJobViaNodesCLLStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...kedin/datahub/upgrade/system/restoreindices/structuredproperties/PropertyDefinitions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.linkedin.datahub.upgrade.system.restoreindices.structuredproperties; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.linkedin.datahub.upgrade.UpgradeStep; | ||
import com.linkedin.datahub.upgrade.system.NonBlockingSystemUpgrade; | ||
import com.linkedin.metadata.entity.AspectDao; | ||
import com.linkedin.metadata.entity.EntityService; | ||
import io.datahubproject.metadata.context.OperationContext; | ||
import java.util.List; | ||
import javax.annotation.Nonnull; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
* A job that reindexes all domain aspects as part of reindexing descriptions This is required to | ||
* fix the analytics for domains | ||
*/ | ||
@Slf4j | ||
public class PropertyDefinitions implements NonBlockingSystemUpgrade { | ||
|
||
private final List<UpgradeStep> _steps; | ||
|
||
public PropertyDefinitions( | ||
@Nonnull OperationContext opContext, | ||
EntityService<?> entityService, | ||
AspectDao aspectDao, | ||
boolean enabled, | ||
Integer batchSize, | ||
Integer batchDelayMs, | ||
Integer limit) { | ||
if (enabled) { | ||
_steps = | ||
ImmutableList.of( | ||
new PropertyDefinitionsStep( | ||
opContext, entityService, aspectDao, batchSize, batchDelayMs, limit)); | ||
} else { | ||
_steps = ImmutableList.of(); | ||
} | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return this.getClass().getName(); | ||
} | ||
|
||
@Override | ||
public List<UpgradeStep> steps() { | ||
return _steps; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...n/datahub/upgrade/system/restoreindices/structuredproperties/PropertyDefinitionsStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.linkedin.datahub.upgrade.system.restoreindices.structuredproperties; | ||
|
||
import static com.linkedin.metadata.Constants.*; | ||
|
||
import com.linkedin.datahub.upgrade.system.AbstractMCLStep; | ||
import com.linkedin.metadata.entity.AspectDao; | ||
import com.linkedin.metadata.entity.EntityService; | ||
import io.datahubproject.metadata.context.OperationContext; | ||
import javax.annotation.Nonnull; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Slf4j | ||
public class PropertyDefinitionsStep extends AbstractMCLStep { | ||
|
||
public PropertyDefinitionsStep( | ||
OperationContext opContext, | ||
EntityService<?> entityService, | ||
AspectDao aspectDao, | ||
Integer batchSize, | ||
Integer batchDelayMs, | ||
Integer limit) { | ||
super(opContext, entityService, aspectDao, batchSize, batchDelayMs, limit); | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return "structured-property-definitions-v1"; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
protected String getAspectName() { | ||
return STRUCTURED_PROPERTY_DEFINITION_ASPECT_NAME; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
protected String getUrnLike() { | ||
return "urn:li:" + STRUCTURED_PROPERTY_ENTITY_NAME + ":%"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Perhaps log the urn and the aspect to the error log line?
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.
both the urn and aspect should be picked up by the structured logging
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.
+1 sgtm