[
https://issues.apache.org/jira/browse/IGNITE-24275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922053#comment-17922053
]
Konstantin Orlov commented on IGNITE-24275:
-------------------------------------------
Below are two tests which failed due to the bug (add these to any subclass of
{{ClusterPerClassIntegrationTest}}):
{code}
@Override
protected void configureInitParameters(InitParametersBuilder builder) {
builder.clusterConfiguration(TestIgnitionManager.PRODUCTION_CLUSTER_CONFIG_STRING);
}
@Test
void test1() {
String address = "127.0.0.1:10800";
try (
IgniteClient client1 = IgniteClient.builder()
.addresses(address)
.build();
IgniteClient client2 = IgniteClient.builder()
.addresses(address)
.build();
) {
client1.sql().execute(null, "CREATE TABLE my_table (id INT PRIMARY
KEY, val INT)");
// Statement below is failed with [IGN-TX-11 Table was dropped],
while the same case executed
// through embedded client or JDBC will succeed.
try (ResultSet<?> rs = client2.sql().execute(null, "SELECT * FROM
my_table")) {
while (rs.hasNext()) {
rs.next();
}
}
}
}
@Test
void test2() {
String address = "127.0.0.1:10800";
try (
IgniteClient client1 = IgniteClient.builder()
.addresses(address)
.build();
) {
// Statement below is failed with [IGN-SQL-4 Failed to validate
query. From line 1, column 104 to line 1, column 111: Object 'MY_TABLE' not
found]
client1.sql().executeScript(""
+ "CREATE TABLE my_table (id INT PRIMARY KEY, val INT);"
+ "START TRANSACTION READ ONLY;"
+ "SELECT COUNT(val) FROM my_table;"
+ "COMMIT;"
);
}
}
{code}
> Sql. Rework or replace HybridTimestampTracker.clientTracker
> -----------------------------------------------------------
>
> Key: IGNITE-24275
> URL: https://issues.apache.org/jira/browse/IGNITE-24275
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Pavel Pereslegin
> Priority: Major
> Labels: ignite-3
>
> In summary, the requirements for a {{HybridTimestampTracker}} (*observable
> time tracker*) are as follows:
> * Observed time can be updated multiple times
> * Observed time can be updated from different threads
> * The updated value should be visible from different threads
> * When updating the time, the tracker must provide a guarantee that the
> updated value is monotonically increasing
> From that perspective current implementation of
> {{HybridTimestampTracker.clientTracker}} is broken.
> * The method {{get()}} returns only initial value (so tracker cannot be used
> multiple times, for example for SQL script processing)
> * Consumer usually stores value to non-volatile field
> * There is no check that the new value is greater than the previous one
> We need to rework {{clientTracker}} to meet requirement or replace it with
> {{atomicTracker}}.
> p.s. check TODO in codebase
--
This message was sent by Atlassian Jira
(v8.20.10#820010)