Skip to content
Snippets Groups Projects
This project is mirrored from https://gitlab.com/gitlab-org/gitaly.git. Pull mirroring updated .
  1. May 23, 2023
  2. May 22, 2023
  3. May 21, 2023
    • Sami Hiltunen's avatar
      Gather coverage from all go test jobs · e7100e8e
      Sami Hiltunen authored
      We're currently gathering coverage only from the test:coverage job.
      This doesn't run with Praefect nor the WAL enabled. Since the test-go
      target is now generating a coverage report for all of the test runs,
      let's upload the report from each job to get a more complete picture
      of the test coverage.
      
      The test:coverage job is still left in place as it parses the total
      test coverage percentage through the regex.
      e7100e8e
    • Sami Hiltunen's avatar
      Generate coverage report from all test runs · 77c67bb9
      Sami Hiltunen authored
      We're currently only generating a coverage report from the cover
      target. This means that we get coverage only from the basic test
      run without Praefect or WAL enabled. This commit changes the test-go
      target to generate coverage report so the other jobs that build on it
      will also have a coverage report generated. While the report is
      generated, the coverage information is not printed by default. cover
      target is left in place to print the coverage information after a
      test run.
      77c67bb9
    • Sami Hiltunen's avatar
      Reuse test-go target to define test-with-praefect · 790e3afe
      Sami Hiltunen authored
      test-with-praefect makefile target is defining one environment
      variable to enable Praefect but is otherwise the same as test-go
      target. Let's reuse the test-go target to share the common code.
      790e3afe
    • Sami Hiltunen's avatar
      Prevent transaction beginning if initialization fails · 39fd09c7
      Sami Hiltunen authored
      Begin currently waits for the TransactionManager to initialize but
      it doesn't check whether the initialization was successful. As the
      transaction will not anyway succeed if the initialization failed,
      return an appropriate error from Begin instead. This way the
      transaction doesn't end up doing any useless work and the error
      message will be clearer than having a random failure at some point
      during the transaction.
      39fd09c7
    • Sami Hiltunen's avatar
      Write-ahead log repository deletions · 9666ac4d
      Sami Hiltunen authored
      Repository deletions need to be write-ahead logged as well. This
      ensures their atomicity and that they can be replicated later as
      part of the log.
      
      Once a repository deletion has been commited, all subsequent Begin
      and Commit calls will fail with a 'repository not found' error. The
      repository is logically deleted but not yet physically. The physical
      deletion needs to wait for open transactions to finish so we don't
      remove the files they are operating on.
      
      For now, it's possible to set other updates in the Transaction even
      if it ultimately removes the repository. Technically this is fine but
      it's a bit non-sensical and we don't have a use case for it in Gitaly.
      We'll probably later improve the interface by splitting out different
      transaction types so UpdateReferences() can't be called on the same
      transaction that deletes the repository.
      9666ac4d
    • Sami Hiltunen's avatar
      Track open transactions in TransactionManager · cd0f8033
      Sami Hiltunen authored
      The TransactionManager needs to keep track of open transactions in
      order to avoid removing data they still need. Given sequence:
      
      - *latest hooks are from index 1*
      - Begin TX2
      - Begin TX3
      - Commit TX3 storing new hooks
      
      The TransactionManager can't prune hooks from index 1 before TX2
      has finished as TX2 may still read them. Once all transactions that
      may be reading the old version of hooks have finished, the
      TransactionManager should prune the old version of the hooks to
      ensure we don't keep filling up the disk.
      
      This commit adds a list to keep track of open transactions. This
      list can later be used to synchronize with open transactions and
      waiting until all open transactions using the data have finished
      prior to removing it.
      
      As Begin is now registering the transactions and thus also writing
      to the TransactionManager's state from a different goroutine than
      Run(), the mutex is changed to a normal mutex from RWMutex.
      cd0f8033
  4. May 19, 2023