So, I tested current master and also upgrade from 4.0 to master and everything works fine on my local machine.
But I've found 2 issues:
1. Jenkins CI for some reason unknown to me doesn't use current master (change-id: I59087ff8902e35b9f7c922eba0a17ba4f0791795) but it uses older commit (most probably revert patch from Eyal [1] with Change-Id: I8c2350aba48619dfa84624b343cfa167d0b6e0ed).as a current master when executing upgrade job from master to patch
2. When we are reverting patches which contain db upgrade scripts which are not last (for example we are dropping db script 04_01_0500 when there's already merged script 04_01_0510) we cannot delete upgrade script otherwise db schema upgrade script fails (revert script [1] is faulty). Only following actions are valid in this case:
a. Comment out code in db upgrade script we want to revert, but leave this script in the repo
b. Remove the db upgrade script and renumber all later db upgrade scripts so there's no hole in db upgrade script numbering
Conclusion: current code in master is OK, we need clean up jenkins job to really use latest merged patch on git master branch.
Martin