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

New ranges tree for legacy2 migration #4887

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

fmarco76
Copy link
Member

During migration from legacy to legacy2 generator the ranges object are not modified but entries are duplicated in a new tree with the correct format and this new tree is used for the following range allocations.

The default ranges object will be ranges_v2 but the value can be modified wit the option -r or --range to the command pki-server <subsystem>-id-generator-update.

Copy link
Contributor

@edewata edewata left a comment

Choose a reason for hiding this comment

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

LGTM. I have a comment about nextRange, but we can address that separately.

conn.add(rangesEntry);
} catch (LDAPException ldae) {
if (ldae.getLDAPResultCode() != 68) {
throw new EBaseException("Impossible create ranges object", ldae);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we append the LDAPException message to the EBaseException message to simplify troubleshooting?

conn.add(rangeEntry);
} catch (LDAPException ldae) {
if (ldae.getLDAPResultCode() != 68) {
throw new EBaseException("Impossible access object in ranges", ldae);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here.

}

@Override
public void execute(CommandLine cmd) throws Exception {
String newRangesName = "ranges_v2";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ideally the default value should be set depending on the generator type, for example:

if (generator == LEGACY_2) {
    newRangesName = "ranges_v2";
}

But since we only use this for SSNv2 it doesn't really matter.

@@ -310,4 +324,71 @@ private void updateRanges(DatabaseConfig dbConfig, LdapBoundConnection conn, Str
conn.modify(serialDN, serialmod);
Copy link
Contributor

@edewata edewata Oct 28, 2024

Choose a reason for hiding this comment

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

Here we're modifying the nextRange used by SSNv1 with a value meant for SSNv2 so the admin will need to restore it to the original value if there's a migration issue. To avoid that I'd suggest moving it to SSNv2 subtree as well (i.e. ou=ranges_v2). We can address this in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this will be in separate PR!

When an instance is updated from legacy generator to the new legacy2
generator the ranges will be stored in a new tree. The default tree
name is "ou=range_v2,<subsystem_base_db>".

The name of the ranges entry can be customised with the option `-r` (or
--range) to the command `pki-server <subsystem>-id-generator-update`.
Copy link

@fmarco76
Copy link
Member Author

@edewata Thanks! I have update following your comments.

@fmarco76 fmarco76 merged commit 1e1e7e7 into dogtagpki:master Oct 28, 2024
159 of 167 checks passed
@fmarco76 fmarco76 deleted the newRangesSSNv2 branch October 28, 2024 17:17
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