-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*Are* indexes supposed to be migrated over or are they regenerated on the target post table data copy? #207
Comments
If you don't mind sharing the logs for which sql command you are talking about? Also are you passing |
ah, I am not, at least not when I execute a start-sync (didn't see that option in the readme?) the command I am using is should I be appending a |
OK, got it. So
So, if you are not using that option, then you shouldn't see any indexes being attempted to be added or deleted during or after sync or switchover. That said, if you are using |
ah! OK. Yeah, I was using --copy-schema with bootstrap, but otherwise I wasn't leveraging that during the start-sync. So, if I want to copy over the table data and that's complete, will I need to manually rebuild the indexes post switchover? |
another confusing aspect:
Got an error: I tried dropping the index on the TARGET that it was erroring out on, and it throws a new error, |
Nope, you don't need to, postgres takes care of that and pg_easy_replicate runs an |
I'm assuming that even though it's not recreating the indexes until post copy, that doesn't mean that indexes will remain at zero until that time, correct? I do see indexes growing on the target (now that I got it replicating without any index errors, that was a schema mismatch), albeit rather slowly. |
OK, so I have run into an issue and I can't ID what the root cause is here. I created a blank target database, and started over from scratch. I did a config_check, then bootstrap with special user role set, with --copy-schema. I can verify that all tables AND their blank indexes are populated over OK. I then did a single table sync and specified --recreate-indices-post-copy at the end. It failed to set up the replication with the error Looking up higher in the output, I see this line where it fails on the DROP INDEX CONCURRENTLY: I verified that it's the same owner name on both source and target databases, on the same table in those databases, and that the owner is the same for both indices on both source and target. |
Just in case I was crazy, I did a psql \di on both source and target databases, and ownership names matched. Just in case, I ran a ALTER INDEX (name) OWNER TO (table owner) on the index, and repeated the sync attempt, and got the same error. Could this be using, or trying to use, the pger generated role to delete that table instead of the connection string role? |
one manual workaround for this is to drop the indexes manually on the target and then initiate replication - that seems to work totally fine. |
So, I think I may be misunderstanding what's going on with what I was originally thinking how this functions. I have a few tables that have extremely large indices, and it looks like the migration is copying them over instead of just doing the table and TOAST data. Is this the expected operation? From where you describe the switchover process, it seems to imply that indices are NOT supposed to be copied over?
The text was updated successfully, but these errors were encountered: