You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by blackfield <ch...@maxpoint.com> on 2017/10/06 20:58:59 UTC

Data (that is inserted via JDBC) is not persisted after cluster restart

Hi,

I configure my Ignite 2.2 nodes to enable persistence to disk.

        
        <property name="persistentStoreConfiguration">
			<bean
class="org.apache.ignite.configuration.PersistentStoreConfiguration"/>
        </property>

After cluster restart, I notice that data that is inserted via JDBC is gone.

Note: if I programmatically create the cache/table and insert entries to the
cache, these data persist properly after cluster restart.

How to reproduce?
1. Enable persistence 
2. Create simple table via SQL
3. Insert data via SQL
4. restart Ignite cluster and perform query against the table

Am I missing some other configuration or is this a bug in 2.2?






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

Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by Denis Magda <dm...@apache.org>.
Everything gets stored under the workdir by default unless you override some of the paths using configurations APIs.

Share the SQL for the table you have troubles with if you want to get assistance from the community.

—
Dens
 
> On Oct 10, 2017, at 11:56 AM, blackfield <ch...@maxpoint.com> wrote:
> 
> I deleted everything under the work dir on all nodes, now, I am not able to
> reproduce it for new tables that I created.
> 
> I am still seeing the issue on one of the tables that I created in the past. 
> 
> We experimented with so many different things, perhaps, something was
> cached/stored elsewhere beside under the default work dir?
> 
> Does Ignite store some metadata else where beside under the default work
> dir?
> 
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by blackfield <ch...@maxpoint.com>.
I deleted everything under the work dir on all nodes, now, I am not able to
reproduce it for new tables that I created.

I am still seeing the issue on one of the tables that I created in the past. 

We experimented with so many different things, perhaps, something was
cached/stored elsewhere beside under the default work dir?

Does Ignite store some metadata else where beside under the default work
dir?







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

Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello blackfield!

I have tried to reproduce your scenario, but to no avail.

So I started AI with your config:
~/Downloads/apache-ignite-fabric-2.2.0-bin% bin/ignite.sh -v
config/IgniteConfig.xml 
[15:13:29,179][INFO][main][GridDiscoveryManager] Topology snapshot [ver=1,
servers=1, clients=0, CPUs=8, heap=1.0GB]

Activated it:
~/Downloads/apache-ignite-fabric-2.2.0-bin% bin/control.sh --host 127.0.0.1
--port 11211 --activate

Created a table with DBeaver:
CREATE TABLE IF NOT EXISTS Person (
  age int, id int, city_id int, name varchar, company varchar,
  PRIMARY KEY (name, id))
  WITH "template=partitioned,backups=1"

Added a few records:
INSERT INTO Person(age, id, city_id, name, company) VALUES (29, 2, 253,
'You', 'XX')

Stopped server node, stopped DBeaver, started server node, activated it, ran
DBeaver and queries Person table, all entries are there (see screenshot)
Screenshot_DBeaver.png
<http://apache-ignite-users.70518.x6.nabble.com/file/t1312/Screenshot_DBeaver.png>  

Do I miss anything? You can see connection string in screenshot.

Regards,



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

Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by blackfield <ch...@maxpoint.com>.
The config file:
IgniteConfig.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1387/IgniteConfig.xml>  

No source code is provided as the issue is reproduce-able from SQL tool such
as DBeaver. 

As far as logs, I have not configured ignite.-log4j.xml (as in it is still
default). Do you want me to configure it differently?  Also, I believe the
default log dir is  $IGNITE_HOME/work/logs?



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

Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by Denis Magda <dm...@apache.org>.
Did quick validation on my side. Could successfully preload data using JDBC thin driver and query it after the cluster restart. Used this script [1] and sqline tool mentioned in that GitHub project.

Please share:
- configurations for cluster nodes.
- log files from all the nodes and applications using JDBC driver (the logs are need before and after the restart).
- source code you use.

[1] https://github.com/dmagda/ignite_world_demo/blob/master/ignite_world.sql <https://github.com/dmagda/ignite_world_demo/blob/master/ignite_world.sql>

—
Denis

> On Oct 6, 2017, at 3:19 PM, blackfield <ch...@maxpoint.com> wrote:
> 
> I think it is unlikely I have problem described in IGNITE-6285. 
> It is consistent that the data on the table that is inserted via
> IgniteDataStreamer (table created via Ignite getOrCreateCache) persist after
> cluster restart.
> 
> 
> I am using JDBC thin client, I both use it programmatically. I also
> configured DBeaver to use DBeaver, same result.
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by blackfield <ch...@maxpoint.com>.
I think it is unlikely I have problem described in IGNITE-6285. 
It is consistent that the data on the table that is inserted via
IgniteDataStreamer (table created via Ignite getOrCreateCache) persist after
cluster restart.


I am using JDBC thin client, I both use it programmatically. I also
configured DBeaver to use DBeaver, same result.



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

Re: Data (that is inserted via JDBC) is not persisted after cluster restart

Posted by Denis Magda <dm...@apache.org>.
Hi,

It’s unlikely but, anyway, please confirm you haven’t faced this issues:
https://issues.apache.org/jira/browse/IGNITE-6285 <https://issues.apache.org/jira/browse/IGNITE-6285>

What type of JDBC driver are you on? If it’s Ignite Client Driver [1] and you set “streaming” parameter to “true” double check the connection is properly closed [2] (otherwise the data might not be flushed).

If nothing helps share a reproducer with us to facilitate the debugging. If the bug is confirmed you’ll be able to get a fix in the nearest weeks. The community is preparing 2.3 release.

[1] https://apacheignite.readme.io/docs/jdbc-driver#section-jdbc-client-node-driver
[2] https://apacheignite.readme.io/docs/jdbc-driver#section-streaming-mode <https://apacheignite.readme.io/docs/jdbc-driver#section-streaming-mode>

—
Denis

> On Oct 6, 2017, at 1:58 PM, blackfield <ch...@maxpoint.com> wrote:
> 
> Hi,
> 
> I configure my Ignite 2.2 nodes to enable persistence to disk.
> 
> 
>        <property name="persistentStoreConfiguration">
> 			<bean
> class="org.apache.ignite.configuration.PersistentStoreConfiguration"/>
>        </property>
> 
> After cluster restart, I notice that data that is inserted via JDBC is gone.
> 
> Note: if I programmatically create the cache/table and insert entries to the
> cache, these data persist properly after cluster restart.
> 
> How to reproduce?
> 1. Enable persistence 
> 2. Create simple table via SQL
> 3. Insert data via SQL
> 4. restart Ignite cluster and perform query against the table
> 
> Am I missing some other configuration or is this a bug in 2.2?
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/