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

[AMBARI 24678] Config group mapping should allow multiple service instances #2376

Conversation

benyoka
Copy link
Contributor

@benyoka benyoka commented Sep 25, 2018

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.

@asfgit
Copy link

asfgit commented Sep 25, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4067/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Sep 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4076/
Test FAILed.
Test FAILured.

@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 {
Copy link
Member

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?

@asfgit
Copy link

asfgit commented Sep 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4082/
Test FAILed.
Test FAILured.

Copy link
Contributor

@rnettleton rnettleton left a 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?

@benyoka benyoka merged commit 2e6ddbb into apache:branch-feature-AMBARI-14714 Sep 26, 2018
@benyoka benyoka changed the title [AMBARI 24678] [AMBARI 24678] Config group mapping should allow multiple service instances Sep 26, 2018
@asfgit
Copy link

asfgit commented Sep 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4086/
Test FAILed.
Test FAILured.

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