fix(grpc-data): X0 inert all-unknown export rule no longer lowers the principal's limits; ValidateDeployed doc
This commit is contained in:
@@ -23,9 +23,10 @@ public static class DataConnectionValidator
|
||||
/// Node-side re-validation of an already-deployed artifact (artifact parse, origin catalog compile). Identical to
|
||||
/// <see cref="Validate(DraftSnapshot)"/> except that operation bits outside <see cref="DataOperationSets.Understood"/>
|
||||
/// are IGNORED rather than rejected (X0 tolerant reader): a newer central may author them, and rejecting would take
|
||||
/// down every data connection/export on the node. The understood subset is still validated (a row must be non-empty;
|
||||
/// a mapping may not grant an understood operation its connection lacks), and every consumer of the rows masks the
|
||||
/// rest away, so an unknown bit grants nothing (fail closed).
|
||||
/// down every data connection/export on the node. The understood subset is still validated (a mapping may not grant
|
||||
/// an understood operation its connection lacks), and every consumer of the rows masks the rest away, so an unknown bit
|
||||
/// grants nothing (fail closed). A row must carry SOME bit (zero is still invalid), but it may carry only unknown
|
||||
/// bits: such a row is kept and grants nothing.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<ValidationError> ValidateDeployed(DraftSnapshot draft) => Validate(draft, deployed: true);
|
||||
|
||||
|
||||
@@ -182,7 +182,10 @@ public sealed partial class LocalExportCatalog
|
||||
|
||||
internal DataLimits LimitsFor(string principal, DataLimits limits)
|
||||
{
|
||||
var rules = _exports.Where(x => string.Equals(x.Principal, principal, StringComparison.OrdinalIgnoreCase)).ToArray();
|
||||
// An inert rule (X0: only operation bits this build does not implement) grants nothing, so it cannot lower the
|
||||
// principal's limits on its other exports either.
|
||||
var rules = _exports.Where(x => string.Equals(x.Principal, principal, StringComparison.OrdinalIgnoreCase)
|
||||
&& x.Operations != DataOperations.None).ToArray();
|
||||
return rules.Length == 0 ? limits : limits with
|
||||
{
|
||||
MaxBatchItems = Math.Min(limits.MaxBatchItems, rules.Min(x => x.Batch)),
|
||||
|
||||
Reference in New Issue
Block a user