-
Notifications
You must be signed in to change notification settings - Fork 1
Improve metadata bwc test for Logical Replication #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
tests/bwc/test_rolling_upgrade.py
Outdated
# Set up tables for logical replications | ||
if int(path.from_version.split('.')[0]) >= 5 and int(path.from_version.split('.')[1]) >= 10: | ||
c.execute("create table doc.x (a int) clustered into 1 shards with (number_of_replicas=0)") | ||
expected_active_shards += 1 | ||
c.execute("create publication p for table doc.x") | ||
with connect(replica_cluster.node().http_url, error_trace=True) as replica_conn: | ||
rc = replica_conn.cursor() | ||
rc.execute("create table doc.rx (a int) clustered into 1 shards with (number_of_replicas=0)") | ||
rc.execute("create publication rp for table doc.rx") | ||
rc.execute(f"create subscription rs connection 'crate://localhost:{cluster.node().addresses.transport.port}?user=crate&sslmode=sniff' publication p") | ||
wait_for_active_shards(rc) | ||
c.execute(f"create subscription s connection 'crate://localhost:{replica_cluster.node().addresses.transport.port}?user=crate&sslmode=sniff' publication rp") | ||
wait_for_active_shards(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remove the calls to wait_for_active_shards
and move onto rolling upgrades immediately, I observe unexpected behaviours like UnavailableShardsException or the number of rows replicated do not add up correctly. But to my knowledge, users are recommended to wait for active shards before upgrading, so this is not an issue?
tests/bwc/test_rolling_upgrade.py
Outdated
# account for replication delay, wait_for_active_shards nor REFRESH help here | ||
time.sleep(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better option for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, use assert_busy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
a47df1d
to
e4b1b28
Compare
this is unexpected behaviour from a logically replicated shard -
|
It is an intermittent behaviour(was able to reproduce but rarely on the latest master from 1 node cluster to 1 node cluster) that does seem |
tests/bwc/test_rolling_upgrade.py
Outdated
c.execute("insert into doc.x values (1)") | ||
rc.execute("insert into doc.rx values (1)") | ||
|
||
rc.execute("select count(*) from doc.x") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crate.client.exceptions.ProgrammingError: RelationUnknown[Relation 'doc.x' unknown]
io.crate.exceptions.RelationUnknown: Relation 'doc.x' unknown
at io.crate.exceptions.RelationUnknown.of(RelationUnknown.java:46)
Guessing it means that the DROP stmt succeeded, looking into it.
The first commit tests LR during rolling upgrade
Hi @seut could you take a look? BTW, this problem is intermittent especially when tried to reproduce manually. |
@jeeminso |
Summary of the changes / Why this is an improvement
Checklist