[SERVER-11008] New enterprise deb and rpm packages must conflict with non-enterprise packages Created: 02/Oct/13  Updated: 11/Jul/16  Resolved: 21/Dec/13

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: Tyler Brock Assignee: Ernie Hershey
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
Backwards Compatibility: Fully Compatible
Operating System: Linux
Steps To Reproduce:

vagrant@precise64:~$ sudo apt-get install mongodb-enterprise-unstable
vagrant@precise64:~$ sudo apt-get install mongodb-org-unstable     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-shell mongodb-org-unstable-tools
The following NEW packages will be installed:
  mongodb-org-unstable mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-shell mongodb-org-unstable-tools
0 upgraded, 5 newly installed, 0 to remove and 149 not upgraded.
Need to get 97.6 MB of archives.
After this operation, 249 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist/mongodb mongodb-org-unstable-shell amd64 2.5.2 [3,561 kB]
Get:2 http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist/mongodb mongodb-org-unstable-server amd64 2.5.2 [8,093 kB]
Get:3 http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist/mongodb mongodb-org-unstable-mongos amd64 2.5.2 [5,760 kB]
Get:4 http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist/mongodb mongodb-org-unstable-tools amd64 2.5.2 [80.2 MB]
Get:5 http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist/mongodb mongodb-org-unstable amd64 2.5.2 [3,028 B]                                                                
Fetched 97.6 MB in 17s (5,737 kB/s)                                                                                                                                                    
Selecting previously unselected package mongodb-org-unstable-shell.
(Reading database ... 51330 files and directories currently installed.)
Unpacking mongodb-org-unstable-shell (from .../mongodb-org-unstable-shell_2.5.2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mongodb-org-unstable-shell_2.5.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongo', which is also in package mongodb-enterprise-unstable 2.5.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-unstable-server.
Unpacking mongodb-org-unstable-server (from .../mongodb-org-unstable-server_2.5.2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mongodb-org-unstable-server_2.5.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongod', which is also in package mongodb-enterprise-unstable 2.5.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-unstable-mongos.
Unpacking mongodb-org-unstable-mongos (from .../mongodb-org-unstable-mongos_2.5.2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mongodb-org-unstable-mongos_2.5.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongos', which is also in package mongodb-enterprise-unstable 2.5.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-unstable-tools.
Unpacking mongodb-org-unstable-tools (from .../mongodb-org-unstable-tools_2.5.2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mongodb-org-unstable-tools_2.5.2_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongoperf', which is also in package mongodb-enterprise-unstable 2.5.2
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-unstable.
Unpacking mongodb-org-unstable (from .../mongodb-org-unstable_2.5.2_amd64.deb) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mongodb-org-unstable-shell_2.5.2_amd64.deb
 /var/cache/apt/archives/mongodb-org-unstable-server_2.5.2_amd64.deb
 /var/cache/apt/archives/mongodb-org-unstable-mongos_2.5.2_amd64.deb
 /var/cache/apt/archives/mongodb-org-unstable-tools_2.5.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Participants:

 Description   

This should produce a conflict and not try to install mongodb-org-unstable (which subsequently fails)



 Comments   
Comment by Tyler Brock [ 31/Dec/13 ]

That behavior seems correct to me. Nice work.

Comment by Ernie Hershey [ 21/Dec/13 ]

As far as I can tell based on testing many permutations is this is ideal behavior. Also from what I've seen overall as a dpkg user I don't think it will ever prevent you from installing conflicting packages (unless we leave them not conflicting and they error on file overwriting as in the original reproduction steps). Warning the user and uninstalling the packages that are already installed seems okay to me.

Here's my transcript from the same scenario as the original reproduction with the latest packages:

ubuntu@domU-12-31-39-10-32-61:~$ sudo apt-get install mongodb-enterprise-unstable # succeeded
ubuntu@domU-12-31-39-10-32-61:~$ sudo apt-get install mongodb-org-unstable
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsensors4 libsnmp15 libsnmp-base snmp libperl5.14
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-shell mongodb-org-unstable-tools
The following packages will be REMOVED:
  mongodb-enterprise-unstable mongodb-enterprise-unstable-mongos mongodb-enterprise-unstable-server mongodb-enterprise-unstable-shell
  mongodb-enterprise-unstable-tools
The following NEW packages will be installed:
  mongodb-org-unstable mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-shell mongodb-org-unstable-tools
0 upgraded, 5 newly installed, 5 to remove and 125 not upgraded.
Need to get 0 B/109 MB of archives.
After this operation, 41.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 47666 files and directories currently installed.)
Removing mongodb-enterprise-unstable ...
arg: remove
Removing mongodb-enterprise-unstable-mongos ...
Removing mongodb-enterprise-unstable-server ...
mongod stop/waiting
Removing mongodb-enterprise-unstable-shell ...
Removing mongodb-enterprise-unstable-tools ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Selecting previously unselected package mongodb-org-unstable-shell.
(Reading database ... 47620 files and directories currently installed.)
Unpacking mongodb-org-unstable-shell (from .../mongodb-org-unstable-shell_2.5.4_amd64.deb) ...
Selecting previously unselected package mongodb-org-unstable-server.
Unpacking mongodb-org-unstable-server (from .../mongodb-org-unstable-server_2.5.4_amd64.deb) ...
Selecting previously unselected package mongodb-org-unstable-mongos.
Unpacking mongodb-org-unstable-mongos (from .../mongodb-org-unstable-mongos_2.5.4_amd64.deb) ...
Selecting previously unselected package mongodb-org-unstable-tools.
Unpacking mongodb-org-unstable-tools (from .../mongodb-org-unstable-tools_2.5.4_amd64.deb) ...
Selecting previously unselected package mongodb-org-unstable.
Unpacking mongodb-org-unstable (from .../mongodb-org-unstable_2.5.4_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mongodb-org-unstable-shell (2.5.4) ...
Setting up mongodb-org-unstable-server (2.5.4) ...
mongod start/running, process 7055
Setting up mongodb-org-unstable-mongos (2.5.4) ...
Setting up mongodb-org-unstable-tools (2.5.4) ...
Setting up mongodb-org-unstable (2.5.4) ...
ubuntu@domU-12-31-39-10-32-61:~$

Comment by auto [ 12/Oct/13 ]

Author:

{u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}

Message: SERVER-11008 specify Conflicts instead of Breaks
Branch: master
https://github.com/mongodb/mongo/commit/c7a50d739c50a96690a6acb1818a783d618ed64a

Comment by auto [ 04/Oct/13 ]

Author:

{u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}

Message: SERVER-11008 Add full conflicting package name list
Branch: master
https://github.com/mongodb/mongo/commit/fc780bfec97713119dd16c4996cd0c484de4ab71

Comment by Ernie Hershey [ 02/Oct/13 ]

That makes sense to me. In a few cases the distinction is arguable, like distribution packages, but I think for the whole list we should specify "cannot be simultaneously configured" (breaks) more than "A will not operate if B is installed" (conflicts). In most cases the files are in identical locations, so there's no meaningful way to have them installed together. This might change in the future though if we support upgrades and other multiple version scenarios via packages.

Comment by Tyler Brock [ 02/Oct/13 ]

Ok, now that I've read some additional stuff on this page (section 7.9): http://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html

Maybe we want breaks instead of conflicts?

Comment by Ernie Hershey [ 02/Oct/13 ]

Here's every server package name we've released:

mongo-10gen
mongo-10gen-enterprise
mongo-10gen-enterprise-server
mongo-10gen-server
mongo-10gen-unstable
mongo-10gen-unstable-enterprise
mongo-10gen-unstable-enterprise-server
mongo-10gen-unstable-mongos
mongo-10gen-unstable-server
mongo-10gen-unstable-shell
mongo-10gen-unstable-tools
mongo18-10gen
mongo18-10gen-server
mongo20-10gen
mongo20-10gen-server
mongodb-10gen
mongodb-10gen-enterprise
mongodb-10gen-unstable
mongodb-10gen-unstable-enterprise
mongodb-10gen-unstable-mongos
mongodb-10gen-unstable-server
mongodb-10gen-unstable-shell
mongodb-10gen-unstable-tools
mongodb18-10gen
mongodb20-10gen

Comment by Ernie Hershey [ 02/Oct/13 ]

The list of conflicts is going to be huge -

Flavors to account for:
1) Linux Distribution Maintained / MongoDB Inc. Maintained
2) Old names / new names
3) Split / not split
4) Stable / Unstable
5) Community / Enterprise

32 (2^5) total permutations and anything with split sub-packages will actually be 4 packages to conflict with.

Generated at Thu Feb 08 03:24:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.