... and forgot to ask: does the migration plugin preserve the original change numbers?
On 19 Feb 2016, at 22:36, Luca Milanesio <Luca.Mi...@gmail.com> wrote:Hi Matthias,good point about the importer plugin, I need to experiment it for differential upgrade.I guess it may take a while to import over 20K projects, so I need to make sure that when the import is completed is able to "add/amend" already imported changes.
... and then set Blue (old Gerrit) to read-only, allow the importer to finalise the remaining bits (hopefully just a couple of mins) and then flip the switch.How does it behave in terms of:a) Workload produced on the Blue (old Gerrit) system ?
b) Ability to work in differential way, adding or amending current changes ?
I see your point, in your case people had to choice !I believe we should drop sometime in the future of Gerrit the Change number in the URL, that would help a lot when migrating / upgrading / merging instances.Example:Current URL for a change:it should become in the future:
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
True, you may have other projects with the Change-Id.However *within* the same project it should be *reasonable* unique isn't it?
Gerrit upgrade cutover plan===========================Basic principle: Blue/Green deployment (see http://martinfowler.com/bliki/BlueGreenDeployment.html)Blue is old-Gerrit, Green is new-GerritPhase-0: Pre-upgrade
Blue-Gerrit replicates repos to Green-Gerrit
Blue-Gerrit DB is transferred to Green-Gerrit every 10 minsGreen-Gerrit index gets updated for new changes every 10 mins
Phase-1: Blue-Gerrit/Git operations set to read-onlyBlocks all POST/PUT/DELETE REST-API on Blue-Gerrit resources
Install plugin script on Blue-Gerrit to block all incoming Git receive-commit with a friendly message ("we are migrating to Greeb-Gerrit, please retry later")
Phase-2: Wait for all pending replication actions to complete
Whilst Blue-Gerrit is in read-only, transfer the Blue-Gerrit DB over the Greeb-Gerrit for the last timeWait until the Gereen-Gerrit replication queue is empty
Phase-3: Green-Gerrit upgradeGreen-Gerrit is upgraded to the new versionGreen-Gerrit started
Trigger online-reindex and cache warm-up
Phase-4: Redirect traffic to Green-GerritFlip the switch and redirect all traffic from Blue-Gerrit to Greeb-Gerrit
I've been testing the Gerrit Blue-Green approach for a week and seems to work :-)See below my feedback on the execution times.Gerrit upgrade cutover plan===========================Basic principle: Blue/Green deployment (see http://martinfowler.com/bliki/BlueGreenDeployment.html)Blue is old-Gerrit, Green is new-GerritPhase-0: Pre-upgradeBlue-Gerrit replicates repos to Green-GerritTypically works with 15s delay, however for new repos may take longer as Gerrit's replication logic is:a) Create a new empty repo using the adminUrlb) Re-schedule a full replication in the queueThe replication queue could be at times quite long ... and you end up with an empty repo on the other side :-(Even worse then replication auto-reload is enabled => replication queue is cleaned and the replication side's repo will remain empty.This isn't nice and needs to be fixed in the replication plugin reload mechanism.Blue-Gerrit DB is transferred to Green-Gerrit every 10 minsGreen-Gerrit index gets updated for new changes every 10 minsIt worked fine, the entire DB transfer + upgrade + reindex can be actually completed in less than 3 mins!Our new infrastructure is massively parallel and the reindex with parallel threads works nicely.Phase-1: Blue-Gerrit/Git operations set to read-onlyBlocks all POST/PUT/DELETE REST-API on Blue-Gerrit resourcesInstall plugin script on Blue-Gerrit to block all incoming Git receive-commit with a friendly message ("we are migrating to Greeb-Gerrit, please retry later")The Git side is easy, the REST-API isn't so easy as the Gerrit UX could be quite unexpected.Need to do some more testing and see if a compensation logic can be found.
RewriteCond %{REQUEST_METHOD} =PUT
RewriteRule ^(.*) "-" [F]
RewriteCond %{REQUEST_METHOD} =POST
RewriteRule ^(.*) "-" [F]
RewriteCond %{REQUEST_METHOD} =DELETE
RewriteRule ^(.*) "-" [F]
The only drawback is that the user will get a generic "Forbidden" message, without the possibility to say "Hey! we are upgrading the system, please come back later".
Phase-2: Wait for all pending replication actions to completeWhilst Blue-Gerrit is in read-only, transfer the Blue-Gerrit DB over the Greeb-Gerrit for the last timeWait until the Gereen-Gerrit replication queue is emptyDone and it should take no more than 3 minutes.Phase-3: Green-Gerrit upgradeGreen-Gerrit is upgraded to the new versionGreen-Gerrit startedTrigger online-reindex and cache warm-upThis phase can be actually reduced to only "cache warm-up" as I managed to include Phase-0 (pre-upgrade) the upgrade + index update.The most critical parts of the cache warm-up are:- project cache- groups cacheOf the two, the groups cache is the most critical of all as it relies on GitHub API which are (unfortunately) quite slow and unstable.Additionally they may consider the "cache warm-up" as possible DoS attack (they are quite paranoid about that nowadays) and then throttling the group lookups.I may consider to do a "phased" warm-up and allow some traffic through anyway.
We actually implemented the zero-downtime cut-over plan discussed here ... and worked 100% !
No outages reported by PingDom or by users.I have published a full report on:
The experience could be useful for others (non-Googlers) that need a ZeroDowntime roll-out and failover without necessarily having to implement multi-master.Hope this helps other people !
--
On 22 Mar 2016, at 10:42, Saša Živkov <ziv...@gmail.com> wrote:On Mon, Mar 21, 2016 at 10:50 PM, lucamilanesio <luca.mi...@gmail.com> wrote:We actually implemented the zero-downtime cut-over plan discussed here ... and worked 100% !Cool!No outages reported by PingDom or by users.I have published a full report on:This looks like a report for your users.The technical side of it is only available in this discussion thread, right?Do you plan to summarize the discussion done here?