pgsync icon indicating copy to clipboard operation
pgsync copied to clipboard

New documents not being created on database insert

Open lane711 opened this issue 4 years ago • 6 comments

Hello, I am running the docker version of the airbnb demo. When I insert new records into postgres, I am not seeing the elastic search document count increase. I do however see "Polling db airbnb: 2 item(s)" logged Screen Shot 2021-09-27 at 12 52 55 PM .

Also, are there instructions on how to setup pgsync for an existing database somewhere? I want to continue running pgsync in docker, but have it work with a db running on bare metal on my local Mac.

Thanks Lane

lane711 avatar Sep 27 '21 18:09 lane711

I think the getting started section might be the best things we have. https://pgsync.com/getting-started. I can create a section specifically for setting up with an existing db.

The logs suggest it is pushing to Elasticsearch. Do you see any error previously?

toluaina avatar Sep 28 '21 09:09 toluaina

@toluaina , even I am facing the same Issue. New records are not going to ES, but it is showing polling count correctly in PGSync logs. Also I noticed that if we restart PGSync all the records sync to ES correctly. But its not ideal to restart it everytime.

joshuafernandes1996 avatar Nov 12 '21 13:11 joshuafernandes1996

Data is first held in the replication logs and sometimes this needs to be processed first. I have tried to improve the logging to indicate what pgsync is doing at each stage. My guess is that the initial sync is not yet complete. You can see how this works better with a smaller dataset.

toluaina avatar Nov 14 '21 20:11 toluaina

@toluaina

i did initial sync via bootstrap -c schema.json command and it's get done successfully now after a month new records not going to ES, but it's showing pulling count currently in PGSync logs. whenever I do pgsync -c schema.json it will pull new records to ES.

In which direction should I look? Is there something wrong with the Replication slot? What is the minimum replication slot required?

Is there a way we can make sure that all the data are get indexed and flush the logs from the replica slot and reset pgsync pulling count to 0 in files?

AnkitKundariya avatar Dec 03 '21 10:12 AnkitKundariya

@AnkitKundariya The latest version on master should show you more details in the console. Can you post the output here? Also add/update a record in the db and post the result from the colsole

toluaina avatar Dec 03 '21 16:12 toluaina

@toluaina I have my schema with the following details: ewwe

If i am trying to edit existing user, its reflecting the changes in Elasticsearch but its not reflecting new user entry in Elasticsearch. Delete is also working.

Dipesh-Aspire avatar Mar 09 '22 07:03 Dipesh-Aspire