Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Jul 11, 2024

Projections might not be available in a mixed-version scenario where a cluster has nodes which are all blank/uninitialized and the majority of nodes run a version of Khepri with a new machine version while the minority does not have the new machine version's code.

In this case, the cluster's effective machine version will be set to the newer version as the majority of members have access to the new code. The older version members will be unable to apply commands including the register_projection commands that set up these ETS tables. When these ETS tables don't exist, calls like ets:tab2list/1 or ets:lookup/2 cause badarg errors.

We use default empty values when ets:whereis/1 returns undefined for a projection table name. Instead we could use local queries or leader queries. Writing equivalent queries is a fair amount more work and the code would be hard to test. ets:whereis/1 should only return undefined in the above scenario which should only be a problem in our mixed-version testing - not in practice.


This is an automatic backport of pull request #11667 done by Mergify.

Projections might not be available in a mixed-version scenario where a
cluster has nodes which are all blank/uninitialized and the majority
of nodes run a version of Khepri with a new machine version while the
minority does not have the new machine version's code.

In this case, the cluster's effective machine version will be set to
the newer version as the majority of members have access to the new
code. The older version members will be unable to apply commands
including the `register_projection` commands that set up these ETS
tables. When these ETS tables don't exist, calls like `ets:tab2list/1`
or `ets:lookup/2` cause `badarg` errors.

We use default empty values when `ets:whereis/1` returns `undefined` for
a projection table name. Instead we could use local queries or leader
queries. Writing equivalent queries is a fair amount more work and the
code would be hard to test. `ets:whereis/1` should only return
`undefined` in the above scenario which should only be a problem in
our mixed-version testing - not in practice.

(cherry picked from commit c490043)
@the-mikedavis the-mikedavis merged commit 1241342 into v4.0.x Jul 11, 2024
@the-mikedavis the-mikedavis deleted the mergify/bp/v4.0.x/pr-11667 branch July 11, 2024 17:56
the-mikedavis added a commit that referenced this pull request Jul 11, 2024
rabbit_db_*: Wrap `ets` calls to projections in `whereis/1` checks (backport #11667) (backport #11677)
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.

2 participants