Minimum row
This commit is contained in:
+18
-12
@@ -1214,27 +1214,33 @@ func validateNativeLockAllocation(dataDir string, rowGeneration []project.TopDat
|
||||
}
|
||||
invalid := 0
|
||||
for key, rowID := range lockData {
|
||||
if rowID > baseBoundaryID {
|
||||
continue
|
||||
}
|
||||
if dataset.RowGeneration == "first_null_row" {
|
||||
if _, ok := nullBaseIDs[rowID]; ok {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if _, ok := baseKeys[key]; ok {
|
||||
continue
|
||||
}
|
||||
if explicitID, ok := explicitModuleIDs[key]; ok && explicitID == rowID {
|
||||
continue
|
||||
}
|
||||
if dataset.RowGenerationMinRow > 0 && rowID < dataset.RowGenerationMinRow {
|
||||
invalid++
|
||||
continue
|
||||
}
|
||||
if rowID > baseBoundaryID {
|
||||
continue
|
||||
}
|
||||
if dataset.RowGeneration == "first_null_row" {
|
||||
if _, ok := nullBaseIDs[rowID]; ok {
|
||||
if rowID >= dataset.RowGenerationMinRow {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
invalid++
|
||||
}
|
||||
if invalid > 0 {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityWarning,
|
||||
Path: dataset.LockPath,
|
||||
Message: fmt.Sprintf("%d lock entrie(s) are inside base id space and will be regenerated above row %d", invalid, baseBoundaryID),
|
||||
Message: fmt.Sprintf("%d lock entrie(s) do not match configured generated-row allocation and will be regenerated", invalid),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1286,7 +1292,7 @@ func validateDatasetOverrideTargetWarnings(dataset nativeDataset, report *Valida
|
||||
rowID = parsed
|
||||
}
|
||||
}
|
||||
if dataset.RowGeneration == "first_null_row" && len(columns) > 0 {
|
||||
if dataset.RowGeneration == "first_null_row" && len(columns) > 0 && rowID >= dataset.RowGenerationMinRow {
|
||||
canonical, err := canonicalizeBaseRow(dataset, columns, row, index)
|
||||
if err == nil && isNativeAllocationNullRow(canonical, columns) {
|
||||
continue
|
||||
@@ -1298,11 +1304,11 @@ func validateDatasetOverrideTargetWarnings(dataset nativeDataset, report *Valida
|
||||
keyToID[key] = rowID
|
||||
}
|
||||
}
|
||||
nextID := nextAvailableID(usedIDs)
|
||||
nextID := nextAvailableIDAtLeast(usedIDs, dataset.RowGenerationMinRow)
|
||||
allocateNextID := func() int {
|
||||
rowID := nextID
|
||||
usedIDs[rowID] = struct{}{}
|
||||
nextID = nextAvailableID(usedIDs)
|
||||
nextID = nextAvailableIDAtLeast(usedIDs, dataset.RowGenerationMinRow)
|
||||
return rowID
|
||||
}
|
||||
modulePaths, err := collectModulePaths(dataset.ModulesDir)
|
||||
|
||||
Reference in New Issue
Block a user