Skip to content

Fix read migration writer lock race - #2944

Merged
Widthdom merged 1 commit into
mainfrom
fix-issue2932
Jun 2, 2026
Merged

Fix read migration writer lock race#2944
Widthdom merged 1 commit into
mainfrom
fix-issue2932

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skip the read-path legacy schema migration when the current database already has the required tables, columns, and indexes.
  • Avoid taking a SQLite writer lock for no-op read migration checks on up-to-date databases.
  • Add a regression test for calling TryMigrateForRead while another connection holds an active write transaction.

Validation

  • dotnet build CodeIndex.sln -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-build --no-restore --filter FullyQualifiedName~LegacySchemaMigrationTests
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-build --no-restore --filter FullyQualifiedName~ConcurrencyTests
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --no-build --no-restore --filter FullyQualifiedName~LegacySchemaMigrationTests
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --no-build --no-restore --filter FullyQualifiedName~ConcurrencyTests
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet format CodeIndex.sln --verify-no-changes
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Codex adversarial review: no blocking/actionable issues found

Documentation / Changelog

  • Added changelog.d/unreleased/2932.fixed.md.

Follow-Up Candidates

  • None.

Fixes #2932

@Widthdom
Widthdom merged commit 8ac863a into main Jun 2, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2932 branch June 2, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate intermittent ConcurrencyTests SQL logic error

1 participant