Geo - Gitlab::Geo::DatabaseTasks.pending_migrations returns migrations already applied
Summary
Configuring Geo locally from scratch using the GitLab Development Kit fails while running make geo-setup
on the secondary.
Steps to reproduce
Follow the steps in https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/geo.md.
Relevant logs and/or screenshots
❯ make geo-setup
grep '^geo-cursor:' Procfile || (printf ',s/^#geo-cursor/geo-cursor/\nwq\n' | ed -s Procfile)
geo-cursor: exec /usr/bin/env RAILS_ENV=development RAILS_RELATIVE_URL_ROOT=$relative_url_root support/geo-logcursor
/usr/local/bin/initdb --locale=C -E utf-8 postgresql-geo/data
The files belonging to this database system will be owned by user "douglasalexandre".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory postgresql-geo/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... America/Sao_Paulo
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/local/bin/pg_ctl -D postgresql-geo/data -l logfile start
grep '^postgresql-geo:' Procfile || (printf ',s/^#postgresql-geo/postgresql-geo/\nwq\n' | ed -s Procfile)
postgresql-geo: exec support/postgresql-signal-wrapper /usr/local/bin/postgres -D /Users/douglasalexandre/Workspace/gdk-geo/postgresql-geo/data -k /Users/douglasalexandre/Workspace/gdk-geo/postgresql-geo -h ''
support/bootstrap-geo
16:39:55 postgresql-geo.1 | started with pid 28683
16:39:55 postgresql-geo.1 | 2019-07-24 16:39:55.553 -03 [28684] LOG: listening on Unix socket "/Users/douglasalexandre/Workspace/gdk-geo/postgresql-geo/.s.PGSQL.5432"
16:39:55 postgresql-geo.1 | 2019-07-24 16:39:55.566 -03 [28685] LOG: database system was shut down at 2019-07-24 16:39:54 -03
16:39:55 postgresql-geo.1 | 2019-07-24 16:39:55.569 -03 [28684] LOG: database system is ready to accept connections
Created database 'gitlabhq_geo_development'
Created database 'gitlabhq_geo_test'
-- enable_extension("plpgsql")
-> 0.0128s
-- create_table("event_log_states", {:primary_key=>"event_id", :id=>:bigint, :force=>:cascade})
-> 0.0045s
-- create_table("file_registry", {:id=>:serial, :force=>:cascade})
-> 0.0130s
-- create_table("job_artifact_registry", {:id=>:serial, :force=>:cascade})
-> 0.0098s
-- create_table("project_registry", {:id=>:serial, :force=>:cascade})
-> 0.0460s
-- enable_extension("plpgsql")
-> 0.0158s
-- create_table("event_log_states", {:primary_key=>"event_id", :id=>:bigint, :force=>:cascade})
-> 0.0045s
-- create_table("file_registry", {:id=>:serial, :force=>:cascade})
-> 0.0156s
-- create_table("job_artifact_registry", {:id=>:serial, :force=>:cascade})
-> 0.0129s
-- create_table("project_registry", {:id=>:serial, :force=>:cascade})
-> 0.0413s
You have 41 pending migrations:
20170206203234 CreateProjectRegistry
20170223033541 CreateFileRegistry
20170302005747 AddIndexToProjectIdOnProjectRegistry
20170526214010 ConvertFileBytesToInt64
20170605154253 CreateEventLogState
20170606155045 AddNeedsResyncToProjectRegistry
20170614201943 AddLastWikiSyncedAtToProjectRegistry
20170627195211 AddIndexToProjectRegistry
20170906174622 RemoveDuplicatesFromProjectRegistry
20170906182752 AddUniqueIndexToProjectIdOnProjectRegistry
20171005045404 RemoveFileUploadsFromRegistry
20171009162208 AddFileRegistrySuccess
20171009162209 AddFileRegistrySuccessIndex
20171101105200 AddRetryCountFieldsToRegistries
20171115143841 AddLastSyncFailureToProjectRegistry
20180201154345 AddRepositoryVerificationToProjectRegistry
20180314175612 AddPartialIndexToProjectRegistyVerificationFailureColumns
20180315222132 AddPartialIndexToProjectRegistyChecksumColumns
20180320011914 RemoveLastVerificationFailedColumnsFromGeoProjectRegistry
20180320013929 RemoveLastVerificationAtColumnsFromGeoProjectRegistry
20180321144947 ChangeRepositoryVerificationChecksumToSha
20180322062741 MigrateCiJobArtifactsToSeparateRegistry
20180323182105 AddMissingOnPrimaryToFileRegistry
20180326171626 RemoveOldRepositoryVerificationChecksumFromGeoProjectRegistry
20180327071612 AddPartialIndexToProjectRegistyChecksumShaColumns
20180331055706 DeleteJobArtifactsFromFileRegistry
20180402170913 AddMissingOnPrimaryToJobArtifactRegistry
20180405074130 AddPartialIndexProjectRepositoryVerification
20180412213305 AddIndexToArtifactIdOnJobArtifactRegistry
20180419174834 AddChecksumMismatchFieldsToProjectRegistry
20180419192603 AddIndexesToChecksumMismatchFieldsOnProjectRegistry
20180427114641 AddRepositoryCheckToGeoProjectRegistry
20180510223634 SetResyncFlagForRetriedProjects
20180613184349 AddResyncWasScheduledAtToProjectRegistry
20180727221937 AddMissingOnPrimaryToProjectRegistry
20180802215313 AddRetryVerificationFieldsToProjectRegistry
20180803160048 AddSyncedRepositoriesPartialIndex
20180806011909 AddFailedSynchronizationsPartialIndex
20180806020615 AddPendingSynchronizationsPartialIndex
20181213184140 AddLastVerificationColumnsToProjectRegistry
20190314201959 AddChecksumMismatchedColumndsToProjectRegistry
Run `rake geo:db:migrate` to update your database then try again.
support/bootstrap-geo failed
make: *** [postgresql/geo] Error 1
~/Workspace/gdk-geo master 20s
❯ 16:40:13 system | SIGTERM received, starting shutdown
16:40:13 system | sending SIGTERM to all processes
16:40:13 postgresql-geo.1 | 2019-07-24 16:40:13.624 -03 [28684] LOG: received fast shutdown request
16:40:13 postgresql-geo.1 | 2019-07-24 16:40:13.625 -03 [28684] LOG: aborting any active transactions
16:40:13 postgresql-geo.1 | 2019-07-24 16:40:13.626 -03 [28684] LOG: background worker "logical replication launcher" (PID 28691) exited with exit code 1
16:40:13 postgresql-geo.1 | 2019-07-24 16:40:13.626 -03 [28686] LOG: shutting down
16:40:13 postgresql-geo.1 | 2019-07-24 16:40:13.645 -03 [28684] LOG: database system is shut down
16:40:13 postgresql-geo.1 | Sending INT to 28684
16:40:13 postgresql-geo.1 | exited with code 0