fix(grpc-data): X0 node-side re-validation tolerates only the reserved bits; runtime logger via init property
P02 GrpcDataArtifactReadTests pins an arbitrary bit (1<<30) as a malformed row that fails closed; keep that and tolerate only DataOperationSets.Reserved. P07 GrpcDataHotRouteContinuityTests reflects over the runtime constructor shape, so the logger moves from a ctor parameter to an init property.
This commit is contained in:
@@ -21,9 +21,10 @@ public static class DataConnectionValidator
|
||||
|
||||
/// <summary>
|
||||
/// Node-side re-validation of an already-deployed artifact (artifact parse, origin catalog compile). Identical to
|
||||
/// <see cref="Validate(DraftSnapshot)"/> except that operation bits this build does not understand 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. Each consumer of the rows keeps only the bits it understands (fail closed).
|
||||
/// <see cref="Validate(DraftSnapshot)"/> except that the X0-RESERVED operation bits (<see cref="DataOperationSets.Reserved"/>)
|
||||
/// are IGNORED rather than rejected: a newer central may author them, and rejecting would take down every data
|
||||
/// connection/export on the node. Each consumer of the rows keeps only the bits it understands (fail closed). A bit
|
||||
/// outside both sets is still a malformed row (nothing can author it).
|
||||
/// </summary>
|
||||
public static IReadOnlyList<ValidationError> ValidateDeployed(DraftSnapshot draft) => Validate(draft, deployed: true);
|
||||
|
||||
@@ -33,8 +34,8 @@ public static class DataConnectionValidator
|
||||
var errors = new List<ValidationError>();
|
||||
void Add(string code, string id, string message) => errors.Add(new(code, message, id));
|
||||
bool Same(string? a, string? b) => Ids.Equals(a, b);
|
||||
bool ValidOps(DataOperations operations) => operations != DataOperations.None &&
|
||||
(deployed || (operations & ~KnownOperations) == 0);
|
||||
var accepted = deployed ? KnownOperations | DataOperationSets.Reserved : KnownOperations;
|
||||
bool ValidOps(DataOperations operations) => operations != DataOperations.None && (operations & ~accepted) == 0;
|
||||
DataOperations Understood(DataOperations operations) => deployed ? operations & DataOperationSets.Understood : operations;
|
||||
bool NodesValid(IEnumerable<string> ids, string owner)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user