Skip to content
Snippets Groups Projects
  1. Jun 01, 2022
    • Yaroslav Dynnikov's avatar
      fix: pytest raft_status assertion message · 4250a0c8
      Yaroslav Dynnikov authored
      Since commit d87dd4ca `leader_id` became an `Option`, so the `None`
      value isn't rendered in the `picolib.raft_status` response:
      
      ```python
      status={'is_ready': False, 'raft_state': 'Follower', 'id': 1}
      ```
      
      It makes pytest complain about missing argument:
      
      ```
      cluster2 = Cluster("127.0.0.1:3300", n=2)
      
          def test_restart_leader(cluster2: Cluster):
              i1, i2 = cluster2.instances
              i1.assert_raft_status('Leader')
              i2.assert_raft_status('Follower')
      
              i1.restart()
      >       i1.wait_ready()
      
      test/int/test_joining.py:209:
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      ../../.local/share/virtualenvs/picodata-6sv6l6y-/lib/python3.10/site-packages/funcy/decorators.py:45:
      in wrapper
          return deco(call, *dargs, **dkwargs)
      ../../.local/share/virtualenvs/picodata-6sv6l6y-/lib/python3.10/site-packages/funcy/flow.py:127:
      in retry
          return call()
      ../../.local/share/virtualenvs/picodata-6sv6l6y-/lib/python3.10/site-packages/funcy/decorators.py:66:
      in __call__
          return self._func(*self._args, **self._kwargs)
      test/int/conftest.py:305: in wait_ready
          status = self._raft_status()
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      
      self = Instance(i1, listen=127.0.0.1:3301)
      
          def _raft_status(self) -> RaftStatus:
              status = self.call("picolib.raft_status")
              assert isinstance(status, dict)
              eprint(f"{status=}")
      >       return RaftStatus(**status)
      E       TypeError: RaftStatus.__init__() missing 1 required positional
      argument: 'leader_id'
      
      test/int/conftest.py:280: TypeError
      ```
      
      This patch fixes the failure message:
      
      ```
      self = Instance(i1, listen=127.0.0.1:3301)
      
          @funcy.retry(tries=20, timeout=0.1)
          def wait_ready(self):
              status = self._raft_status()
      >       assert status.is_ready
      E       AssertionError: assert False
      E        +  where False = RaftStatus(id=1, raft_state='Follower',
      is_ready=False, leader_id=None).is_ready
      
      test/int/conftest.py:306: AssertionError
      ```
      4250a0c8
    • Sergey V's avatar
      feat: --cluster-id parameter · f8ac1dbe
      Sergey V authored
      * Make `--cluster-id` CLI mandatory.
      * Handle cluster_id mismatch in raft_join.
        When an instance attempts to join the cluster and the instances's
        `--instance-id` parameter mismatches the cluster_id of the cluster
        an error is raised inside the raft_join handler.
      f8ac1dbe
    • Sergey V's avatar
      39ef4e09
    • Sergey V's avatar
      docs: improve versioning.md · 9ce2eb92
      Sergey V authored
      9ce2eb92
    • Sergey V's avatar
      docs: fix typos (ru vs en) · d57b26d6
      Sergey V authored
      d57b26d6
    • Georgy Moshkin's avatar
      refactor(discovery): redundant allocation + readability · 58e1e25d
      Georgy Moshkin authored and Georgy Moshkin's avatar Georgy Moshkin committed
      58e1e25d
  2. May 31, 2022
  3. May 30, 2022
  4. May 26, 2022
  5. May 25, 2022
  6. May 24, 2022
  7. May 23, 2022
  8. May 21, 2022
    • Yaroslav Dynnikov's avatar
      refactor: employ topology module in start_boot · 33ac49d9
      Yaroslav Dynnikov authored
      It's necessary to incapsulate topology management logics away from main.
      33ac49d9
    • Yaroslav Dynnikov's avatar
      feature: topology module · 955aa02e
      Yaroslav Dynnikov authored
      It encapsulates the logics of a JoinRequest batch processing.
      
      Topology module will be quite important in picodata. This first version
      misses a lot of features, but a few commits later it's going to
      implement quite a lot of logics.
      
      When a new instance is joined - there's one complex thing: raft leader
      has to decide where this new instance is going to be emplaced, i.e. what
      replicaset should it join. There're many different parameters have an
      influence - `repliction_factor`, `failure-domain`, and of course the
      existing topology. So, this new `topology` module must make the decision.
      
      This patch only refactors the current Picodata behavior, and doesn't
      bring new features for its users. Instead, it opens the door to a future
      development.
      
      Also, this patch provides a unit-testing basis for the future features.
      955aa02e
  9. May 20, 2022
Loading