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
[AMBARI 24678] Config group mapping should allow multiple service instances #2376
[AMBARI 24678] Config group mapping should allow multiple service instances #2376
Conversation
Refer to this link for build results (access rights to CI server needed): |
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
Outdated
Show resolved
Hide resolved
Refer to this link for build results (access rights to CI server needed): |
@TableGenerator(name = "confgroupclusterconfigmapping_id_generator", | ||
table = "ambari_sequences", pkColumnName = "sequence_name", valueColumnName = "sequence_value", | ||
pkColumnValue = "cnfgrpclstrcnfigmpg_id_seq", initialValue = 1 | ||
) | ||
@NamedQueries({ | ||
@NamedQuery(name = "configsByGroup", query = | ||
"SELECT configs FROM ConfigGroupConfigMappingEntity configs " + | ||
"WHERE configs.configGroupId=:groupId") | ||
}) | ||
public class ConfigGroupConfigMappingEntity { |
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.
Can you add the unique constraints defined in the SQL to this class?
Refer to this link for build results (access rights to CI server needed): |
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 patch looks fine to me.
One question though: Should this patch also contain the upgrade-related changes, so that existing ambari-server instance can be upgraded properly? If this work is planned for a separate review, could you please create a JIRA to track that work?
Refer to this link for build results (access rights to CI server needed): |
What changes were proposed in this pull request?
serviceId has been added to the unique constraint (cluster_id, type_name, version_tag) on the clusterconfig table to support multiple service instances.
In consequence, serviceId has also been added to confgroupclusterconfigmapping -> clusterconfig foreign key. The former PK of the confgroupclusterconfigmapping table (version_tag, config_type, cluster_id) now includes serviceId too and is turned to a unique constraint. (Since serviceId is optional, it cannot take part in a primary key.) A surrogate PK has been created instead.
How was this patch tested?
Tested installation manually. Unit test run pending.