-
Notifications
You must be signed in to change notification settings - Fork 15
[AtlasDB Proxy & DbKVS] Part 7: Allow Namespace Overrides for Oracle Connection Config #5942
[AtlasDB Proxy & DbKVS] Part 7: Allow Namespace Overrides for Oracle Connection Config #5942
Conversation
Generate changelog in
|
…hub.com:palantir/atlasdb into jkong/deprecating-inaccurate-oracle-namespacing
…hub.com:palantir/atlasdb into jkong/deprecating-inaccurate-oracle-namespacing
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.
Why would we throw if a useless namespace: X
is specified? It looks like we would silently use X so far, although of course if there's some validation rules about namespace names, then it could end up being invalidated.
namespaceOverride(), | ||
getSid(), | ||
serviceNameConfiguration().map(ServiceNameConfiguration::namespaceOverride)) | ||
.filter(Optional::isPresent) |
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.
this is clever, but a bit arcane - worth a javadoc here explaining the order of precedence.
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.
yep, will add
} | ||
|
||
public abstract Optional<String> namespaceOverride(); |
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.
JsonProperty("namespace")
? Or do we want oracleNamespace
, to explicitly be different from the existing/C* config?
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.
Yep, no harm doing that. I think I went with override
for explicit precedence order, though it's a fair argument saying it's implicit.
return getSid(); | ||
} | ||
return serviceNameConfiguration().map(ServiceNameConfiguration::namespaceOverride); | ||
return Stream.of( |
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.
do we want to log (at least at debug, to match other logs in this class) if namespaceOverride
is present?
Similarly, noting that check enforces exactly one of sid
and serviceNameConfiguration
to be present, which may not be needed any more (although I don't have enough context to know if these params are required elsewhere).
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 we still want the check - the purpose of namespace
is mainly to outline how we identify ourselves to timelock (notice that we don't actually reference this field anywhere else in the DbKVS code). It doesn't actually see any use in connecting to the db
... in which case it probably makes sense for this not to be here.
...dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java
Outdated
Show resolved
Hide resolved
Fair point on useless |
discussed offline: On reflection, I think this should belong in the general DbKVS config as opposed to in the connection config, seeing as it doesn't actually influence the connections to the underlying database (as much as that's where it's computed in the current, incorrect model). |
…hub.com:palantir/atlasdb into jkong/deprecating-inaccurate-oracle-namespacing
Released 0.575.0 |
Although this is not a common operation, internal timelock implementation serializes KVS config, including that of Oracle. In #5942 we accidentally changed the _serialized_ form of the Oracle config. Note that this doesn't affect config _deserialization_, which covers most (non-timelock) AtlasDB users.
Goals (and why):
Pay down some legacy technical debt, and make configuration in atlasdb-proxy look smoother.
==COMMIT_MSG==
Users may now explicitly override the
namespace
of an Oracle connection configuration, which is usually the mechanism by which an individual AtlasDB user identifies itself (e.g. to timelock and possibly to the underlying key-value-service). This was previously automatically assumed to be thesid
of the Oracle database; however, that is not actually the way an individual AtlasDB user identifies itself.==COMMIT_MSG==
Implementation Description (bullets):
namespace
while defaulting to the old behaviour; see above for discussion.Testing (What was existing testing like? What have you done to improve it?):
Concerns (what feedback would you like?):
namespace: X
in their config, though in the worst case it'll just mean that they throw as opposed to doing anything explicitly wrong.Where should we start reviewing?: small
Priority (whenever / two weeks / yesterday): this week please