Replies: 1 comment
-
+1 vote from me. Having MS.Az.SERedis version in addition to SE.Redis version would be very helpful. And I don't think this will have any impact on how we parse lib info in the service, nor how we report on it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current status
ConfigurationOptions.SetLibraryName
(abool
- on/off); it is enabled by defaultConfigurationOptions.LibraryName
null
/whitespace, then from theDefaultOptionsProvider.LibraryName
"SE.Redis"
SetLibraryName
option can be parsed from configuration strings, but theLibraryName
cannotSuffixes
It is often useful to know how a connection is being used in reality, which is more than just the library. At the moment, the
AddLibraryNameSuffix
API allows for this, allowing tokens to be appended to the effective library name. This is de-duplicated and sorted, for consistency; the expectation is that some use-case (for example,IDistributedCache
) can suggest their own token ("DC"
) at any point, and if that results in a new value, it gets added to the set of values. For example,"SE.Redis"
might become"SE-Redis-DC"
. The version is not impacted.Versions
A draft PR exists to suggest making the library version editable. This has been held back as the current proposal involves an API break.
The problem
SE.Redis is often used as an implementation detail of other libraries; this most notably includes (but is not limited to)
NRedisStack
, which:CLIENT
API for this scenarioIt is understood that the intent here is to provide useful
NRedisStack
metadata, including version. However, this results in the two libraries fighting - SE.Redis thinks it owns the client name, and may overstomp thatNRedisStack
value at any time; likewise,NRedisStack
has no direct visibility of that, and has to hack in some unreliable heuristics to attempt to set the client metadata at the appropriate time. This is especially brittle in scenarios involving cluster and / or reconnects, and is discussed here. It is also noted that this feature bypasses bothSetClientName
and the suffix feature.Proposal
(perhaps read the counter-proposal first)
Consider a new API that provides a managed and reasonable approach to library metadata, influenced by the existing suffix feature.
Example; consider the notorious
ANOtherLib
package, version 4.21, running via SE.Redis 2.9.1:ANOtherLib
would be a no-op (we would ignore version changes; that is explicitly not supported). This is effectively a map (dictionary) of additional library pairs.AddLibrary("B","X")
followed byAddLibrary("A", "Y")
would reliably give the outputSE.Redis/A/B
paired with2.9.1/Y/X
)DefaultConfigurationOptions
needs a change, to allow options-providers to suggest library a name/version pair (or pairs?) rather than the existing limited option(the specific details, for example the use of
/
, are subject to change based on testing against target server versions)Mixing this with suffixes
If suffixes are being used, this would be further composed, i.e.
SE.Redis/A/B-DC
; there is no corresponding version tag for data added as suffixes, and there is no suggestion to add one.Observations
This API does not allow an external client to assume total control of the client metadata, i.e. to say "this connection is
ANOtherLib
version 4.2.1". This is very much by design, to avoid multiple libraries (including SE.Redis) arguing and getting into a mess.The existing suffix API has an inherent limitation insofar as it cannot influence RESP2 pub/sub connections; this is a server limitation. I do not propose any changes there: this API would have the same limitation on RESP2.
Counter-proposal
"Keep is simple, stupid"
Just allow random code to over-stomp the library at runtime and assume total ownership / blame; for example:
This is very much "last caller wins"; we would short-circuit no-op calls, making it effectively free to call.
NRedisStack
), but we would not know the SE.Redis versionExecute
to achieve the same goal - we would simply bypass the chaos monkeys, while also respecting the suffix feature andSetClientLibrary
flagBeta Was this translation helpful? Give feedback.
All reactions