Skip to content
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

IGNITE-22620 Implement ReplicaSafeTimeSyncRequest processing for zone replica #5258

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JAkutenshi
Copy link
Contributor

JIRA Ticket: IGNITE-22620

The goal

The reason

The solution

@@ -656,6 +660,41 @@ public void testScanCloseReplicaRequest() throws Exception {
assertDoesNotThrow(tx::commit);
}

@Test
public void testReplicaSafeTimeSyncRequest() throws Exception {
// Prepare a single node cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a single node cluster))

// Create a table to work with.
createTable(node0, zoneName, "test_table");

HybridTimestamp node0safeTimeBefore = node0.currentSafeTimeForZonePartition(zoneId, partId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentSafeTimeForZonePartition may fail with Missing resources for zone if you will call

    ZonePartitionResources getZonePartitionResources(ZonePartitionId zonePartitionId) {
        ZoneResources zoneResources = resourcesByZoneId.get(zonePartitionId.zoneId());

fast enough.

int partId = 0;

// Create a table to work with.
createTable(node0, zoneName, "test_table");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the test in a following way.

  1. Create zone
  2. ensure that safeTime was successfully adjusted. // It should be possible to adjust timestamp even if there's no tables in zone.
  3. Create table
  4. await table creation and ensure that safeTime was successfully adjusted.

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