java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

classic Classic list List threaded Threaded
5 messages Options
yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

Hello.

I am testing ignite 2.8.It sometimes throws following exception:

java.sql.SQLException: Schema change operation failed: Thread got
interrupted while trying to acquire table lock. at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:231)
at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.executeUpdate(JdbcThinStatement.java:380)
at
com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)
at
com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
at
...
java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Do u have any ideas about this?How can I avoid it?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

Hi,

Can you please share full logs from server nodes and from this client too? 

Thanks,
Evgenii

ср, 25 мар. 2020 г. в 04:59, yangjiajun <[hidden email]>:
Hello.

I am testing ignite 2.8.It sometimes throws following exception:

java.sql.SQLException: Schema change operation failed: Thread got
interrupted while trying to acquire table lock. at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:231)
at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.executeUpdate(JdbcThinStatement.java:380)
at
com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)
at
com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
at
...
java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Do u have any ideas about this?How can I avoid it?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

Re: java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

Hello.Sorry for so late to reply.I have got a reproducer.

Here is the test code.Please run it in a ignite without persistence enabled.

public class ConcurrentCreateTable {
    private static Connection conn;

    private static Connection conn1;

    public static void main(String[] args) throws Exception {

        initialize();
        new Thread(new Runnable() {

            @Override
            public void run() {
                while (true) {
                    try (Statement stmt = conn.createStatement()) {
                        stmt.execute(
                            "CREATE TABLE IF NOT EXISTS city1(ID
INTEGER,NAME VARCHAR,NAME1 VARCHAR ,PRIMARY KEY(ID)) WITH
\"template=replicated\";"
                                + "CREATE INDEX IF NOT EXISTS city1_name ON
city1(NAME);CREATE INDEX IF NOT EXISTS city1_name1 on city1(NAME1);");
                        stmt.execute("DROP TABLE IF EXISTS city1");
                        System.out.println("XXX");
                    } catch (SQLException e) {

                        e.printStackTrace();
                    }
                }
            }
        }).start();
        new Thread(new Runnable() {

            @Override
            public void run() {
                while (true) {
                    try (Statement stmt = conn1.createStatement()) {
                        stmt.execute(
                            "CREATE TABLE IF NOT EXISTS city2(ID
INTEGER,NAME VARCHAR, NAME1 VARCHAR ,PRIMARY KEY(ID)) WITH
\"template=replicated\";"
                                + "CREATE INDEX IF NOT EXISTS city2_name ON
city2(NAME);CREATE INDEX IF NOT EXISTS city2_name1 on city2(NAME1);");
                        stmt.execute("DROP TABLE IF EXISTS city2");
                        System.out.println("XXX");
                    } catch (SQLException e) {

                        e.printStackTrace();
                    }
                }
            }
        }).start();
        while (true) {

        }
    }

    private static void initialize() throws Exception {
        Class.forName(Config.IGNITE_DRIVER);
        final Properties props = new Properties();
        conn = DriverManager.getConnection(Config.IGNITE_URL, props);
        conn1 = DriverManager.getConnection(Config.IGNITE_URL, props);
    }
}

Here is the exception:
java.sql.SQLException: Schema change operation failed: Thread got
interrupted while trying to acquire table lock.
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:231)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:559)
        at
        ....
        at java.lang.Thread.run(Thread.java:748)



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

Hello!

I can see how such scenario can expose issues in Apache Ignite's SQL. Can you please create a JIRA ticket with this code?

Regards,
--
Ilya Kasnacheev


сб, 16 мая 2020 г. в 12:51, yangjiajun <[hidden email]>:
Hello.Sorry for so late to reply.I have got a reproducer.

Here is the test code.Please run it in a ignite without persistence enabled.

public class ConcurrentCreateTable {
    private static Connection conn;

    private static Connection conn1;

    public static void main(String[] args) throws Exception {

        initialize();
        new Thread(new Runnable() {

            @Override
            public void run() {
                while (true) {
                    try (Statement stmt = conn.createStatement()) {
                        stmt.execute(
                            "CREATE TABLE IF NOT EXISTS city1(ID
INTEGER,NAME VARCHAR,NAME1 VARCHAR ,PRIMARY KEY(ID)) WITH
\"template=replicated\";"
                                + "CREATE INDEX IF NOT EXISTS city1_name ON
city1(NAME);CREATE INDEX IF NOT EXISTS city1_name1 on city1(NAME1);");
                        stmt.execute("DROP TABLE IF EXISTS city1");
                        System.out.println("XXX");
                    } catch (SQLException e) {

                        e.printStackTrace();
                    }
                }
            }
        }).start();
        new Thread(new Runnable() {

            @Override
            public void run() {
                while (true) {
                    try (Statement stmt = conn1.createStatement()) {
                        stmt.execute(
                            "CREATE TABLE IF NOT EXISTS city2(ID
INTEGER,NAME VARCHAR, NAME1 VARCHAR ,PRIMARY KEY(ID)) WITH
\"template=replicated\";"
                                + "CREATE INDEX IF NOT EXISTS city2_name ON
city2(NAME);CREATE INDEX IF NOT EXISTS city2_name1 on city2(NAME1);");
                        stmt.execute("DROP TABLE IF EXISTS city2");
                        System.out.println("XXX");
                    } catch (SQLException e) {

                        e.printStackTrace();
                    }
                }
            }
        }).start();
        while (true) {

        }
    }

    private static void initialize() throws Exception {
        Class.forName(Config.IGNITE_DRIVER);
        final Properties props = new Properties();
        conn = DriverManager.getConnection(Config.IGNITE_URL, props);
        conn1 = DriverManager.getConnection(Config.IGNITE_URL, props);
    }
}

Here is the exception:
java.sql.SQLException: Schema change operation failed: Thread got
interrupted while trying to acquire table lock.
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:231)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:559)
        at
        ....
        at java.lang.Thread.run(Thread.java:748)



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

Re: java.sql.SQLException: Schema change operation failed: Thread got interrupted while trying to acquire table lock.

Hello.Thanks for u reply.

Please see this JIRA ticket:
https://issues.apache.org/jira/browse/IGNITE-13020



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/