Skip to content

Conversation

@algorandskiy
Copy link
Contributor

Summary

TestVotersReloadFromDiskAfterOneStateProofCommitted had two issues:

  1. Deadlock when assertion failed with lock taken, this prevented ledger to close. Fixed by scoping Lock() and defer Unlock()
  2. Two parallel commit scheduling and handling (one is a normal via newBlock + commitSyncer and a manual one via triggerDeleteVoters) led to the unable to advance tracker db snapshot (775-778): UNIQUE constraint failed: onlineroundparamstail.rnd error when two commitRound are called concurrently. Usually commitRound tolerates such issues by adjusting the commit ranges on retries, but if there is no new blocks or manual sync it is never re-attempted so that committing machinery does not advance voters so the test expectation fail (that lead to the deadlock from (1)).

Test Plan

To reproduce in 1-2m

until go test ./ledger -run TestVotersReloadFromDiskAfterOneStateProofCommitted/test_with_lru_cache -v -count=1 | tee tst.log | grep UNIQUE; do ; done

After the fix the issue was not reproduced in 10m

@codecov
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.91%. Comparing base (f06a86e) to head (9d9e8d6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6024      +/-   ##
==========================================
+ Coverage   55.90%   55.91%   +0.01%     
==========================================
  Files         482      482              
  Lines       68436    68438       +2     
==========================================
+ Hits        38258    38266       +8     
+ Misses      27583    27580       -3     
+ Partials     2595     2592       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants