Skip to content

Commit

Permalink
Added debug log on waiting safe time.
Browse files Browse the repository at this point in the history
  • Loading branch information
vldpyatkov committed Dec 24, 2024
1 parent e1a128e commit a0b2e3e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.ignite.internal.logger.Loggers;
import org.apache.ignite.internal.table.TableViewInternal;
import org.apache.ignite.internal.test.WatchListenerInhibitor;
import org.apache.ignite.internal.testframework.WithSystemProperty;
import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
import org.apache.ignite.lang.IgniteException;
import org.apache.ignite.sql.IgniteSql;
Expand Down Expand Up @@ -143,6 +144,7 @@ public void queryWaitAppropriateSchema() {
* Test correctness of schemes recovery after node restart.
*/
@Test
@WithSystemProperty(key = "IGNITE_PVD_DEBUG", value = "true")
public void checkSchemasCorrectlyRestore() {
Ignite ignite1 = cluster.node(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,19 @@ private CompletableFuture<List<BinaryRow>> processReadOnlyScanRetrieveBatchActio
CompletableFuture<Void> safeReadFuture = isPrimaryInTimestamp(isPrimary, readTimestamp) ? nullCompletedFuture()
: safeTime.waitFor(readTimestamp);

if (IgniteSystemProperties.getBoolean("IGNITE_PVD_DEBUG", false)) {
long start = System.currentTimeMillis();

safeReadFuture.thenRun(() -> {
LOG.info(
"Waiting safe time [isPrimary={}, readTimestamp={}, duration={}]",
isPrimary,
readTimestamp,
System.currentTimeMillis() - start
);
});
}

if (request.indexToUse() != null) {
TableSchemaAwareIndexStorage indexStorage = secondaryIndexStorages.get().get(request.indexToUse());

Expand Down

0 comments on commit a0b2e3e

Please sign in to comment.