-
Notifications
You must be signed in to change notification settings - Fork 139
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
Conversation
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.
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); |
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.
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); |
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.
Same thing here.
} | ||
|
||
@Override | ||
public void execute(CommandLine cmd) throws Exception { | ||
String newRangesName = "ranges_v2"; |
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.
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); |
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.
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.
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.
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`.
e84124c
to
e75f0b2
Compare
Quality Gate passedIssues Measures |
@edewata Thanks! I have update following your comments. |
During migration from
legacy
tolegacy2
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 commandpki-server <subsystem>-id-generator-update
.