Please merge (sort of) couchdb 1.1.1-1 from Debian testing

Bug #903098 reported by Jason Gerard DeRose
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
couchdb (Debian)
New
Unknown
couchdb (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

As UbuntuOne must drop CouchDB sync, we need a plan to minimize the pain this causes to apps built around per-user CouchDB (whether they use desktopcouch, dc3, or UserCouch). Novacut and Dmedia are at the top of my personal list for obvious reasons, but there are no doubt others.

Unfortunately, the `couchdb` package itself is a rather sticky issue because:

  * CouchDB in Ubuntu probably wont carry many Ubuntu-specific changes going forward, so a sync with Debian is probably inevitable

  * However, for desktop CouchDB users, there is an *essential* Ubuntu-specific change: the split into the `couchdb-bin` and `couchdb` packages

For background, the Ubuntu `couchdb-bin` package contains the CouchDB app, and the `couchdb` package contains the init.d script and a few other tidbits needed for starting a system-wide CouchDB at boot. For Novacut and similar apps, it's totally silly to start a system-wide CouchDB for no reason... please don't make us!

So in order of preference, I see 2 possible solutions:

  1. Best case, get the couchdb-bin/couchdb split accepted into Debian, and ship a zero-delta sync in Ubuntu

  2. Worst case, ship a very low-delta merge in Ubuntu, just enough to do the couchdb-bin/couchdb split

For (1), I have a pretty strong case, I think: assuming folks who write CouchDB using apps want unit tests (surely?), they need a sane unit testing idiom, and that's a place where the couchdb-bin/couchdb split makes tons of sense. For Novacut, we have a simple but highly effective Python3 library for this: https://launchpad.net/usercouch

For (2), well, should the maintenance burden for the Ubuntu-specific changes fall on, say, me, I want the delta between Debian and Ubuntu to be as small as possible.

So regardless how it plays out, a low delta from Debian seems the key, so I have a branch that started with 1.1.1-1 from Debian testing and then does the couchdb/couchdb-bin split as minimally as I could figure out:

  https://code.launchpad.net/~jderose/ubuntu/precise/couchdb/1.1.1-low-delta

Thoughts?

Related branches

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

For reference, here is the debian/changelog bits I added:

couchdb (1.1.1-1ubuntu1) precise; urgency=low

  * Started with branch of 1.1.1-1 from Debian testing
  * Split into `couchdb-bin` and `couchdb` packages as found in Ubuntu, with
    goal of keeping delta between Debian and Ubuntu as low as possible
  * Changes from how split is done in Ubuntu:
    - /etc/couchdb/default.ini and /etc/couchdb/default.d are delivered in
      `couchdb-bin` and are owned by root
    - Only `couchdb` has postinst, postrm scripts, meaning `couchdb-bin` does
      not create (or remove) the "couchdb" user/group
  * Changes from Debian:
    - After couchdb.postinst runs, only /etc/couchdb/local.ini and
      /etc/couchdb/local.d are owned by the "couchdb" user, while /etc/couchdb
      remains owned by root

Revision history for this message
John Lenton (chipaca) wrote :

Makes a ton of sense to me.

Revision history for this message
dobey (dobey) wrote :

It looks like your branch has a ton of conflicts in the merge proposal.

But I think the best solution is to get the packaging updated in debian, and not have any ubuntu-specific changes in here.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

@dobey - I'm not sure what's the right and proper way to do this VCS-wise, but what I'm proposing is a sync from Debian plus a small delta. It makes more sense looking at this as a merge into lp:debian/wheezy/couchdb :

https://code.launchpad.net/~jderose/ubuntu/precise/couchdb/1.1.1-low-delta/+merge/85389

That's only a 168 line diff. The 70k line diff and crazy conflicts when merging into lp:ubuntu/couchdb is just a reflection of how giant the delta between Debian and Ubuntu is right now.

I'd love to see this happen in Ubuntu ASAP, and in the meantime I can be working on getting this change into Debian... but if that doesn't happen in time, at least Novacut has a sane CouchDB situation in Precise.

Revision history for this message
Micah Gersten (micahg) wrote :

You can't merge into the Debian VCS branches, you can only merge from them.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

@micahg - gotcha, thanks! I guess it still illustrates the low-delta from Debian.

So what's the correct way for me to propose this sync/merge? I think the important thing is that there be a small, understandable delta between Ubuntu and Debian. I think having a "clean" history in lp:ubuntu/couchdb has only academic value at this point.

Revision history for this message
Micah Gersten (micahg) wrote :

The large diff from Ubuntu -> Ubuntu is fine given that we're going from 1.0.1 to 1.1.0, the uploader should just verify the Debian -> Ubuntu diff is actually minimal. Once could also run filterdiff on the Ubuntu -> Ubuntu diff, limiting to the debian dir, to make sure any needed changes are not lost.

Revision history for this message
Micah Gersten (micahg) wrote :

That should be One, not Once in the last sentence.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Even the diff of just debian/ from precise to wheezy or my proposal is 25k lines as so many cherry-picked patches are being carried (some of which are crazy big... most of that 25k is one patch). So not an easy thing to make sense of.

Aside from the cherry-picking so Ubuntu could continue to ship CouchDB 1.0.x, the only important Ubuntu-specific change was the couchdb/couchdb-bin split (correct my if I'm wrong). And I've carefully recreated this, with an eye on making the change as small and noninvasive as I could manage.

desktopcouch requires a 1-line change for CouchDB 1.1.1 compatibility, after which all its unit tests pass with my proposed couchdb package:

https://code.launchpad.net/~jderose/desktopcouch/uri_file-fix/+merge/85431

dc3 and UserCouch required a similar change, and now all their unit test pass with my proposed couchdb package:

https://launchpad.net/dc3

https://launchpad.net/usercouch

And lastly, all the Microfiber and Dmedia unit tests pass with my proposed couchdb package:

https://launchpad.net/microfiber

https://launchpad.net/dmedia

Also, I just emailed Laszlo Boszormenyi, the Debian CouchDB maintainer, to see if he is open to bringing the couchdb/couchdb-bin split into Debian.

Revision history for this message
Anders Jackson (anders-jackson) wrote :

It's usuall the other way around. Debian spliting packages in many, and Ubuntu want one large, like for wine.

So, an open discussion, where thechnical merits is most important and good patches to Debians package prob. will make Debian and Ubuntu packages look mostly the same.

Keep up the good work!

Changed in couchdb (Debian):
status: Unknown → New
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, after fixing a packaging foobar I made that broke the build on amd64, I now have packages available for testing in the Novacut Daily Builds PPA:

https://launchpad.net/~novacut/+archive/daily?field.series_filter=precise

It's currently building for Oneiric also, to help get wider testing.

I'll continue to advocate for this split in Debian, but considering that Debian #573061 was filed over a year and a half ago, I'm not very confident this can happen in time to be synced from Debian into Precise.

The situation with CouchDB in Ubuntu as it stands makes me very nervous... a huge delta between both Debian and upstream, a complicated set of cherry-picked patches totalling over 20k lines... and probably no Ubuntu core devs able to maintain this delta as, understandably, the business case just isn't there any more.

I'd feel much better if we could get my proposed low-delta 1.1.1 package into Precise ASAP, and then should the split happen in Debian in time, sync from Debian, replacing my proposed package.

Thoughts?

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

After quite a lot of testing, I feel that it's reasonable to push both my proposed couchdb 1.1.1 package and a fixed desktopcouch package out to the Novacut Stable PPA, for both Precise and Oneiric. This should get these proposed changes quite a lot of testing and hopefully help move this forward.

In preparation for this, I've first build all these packages in the Novacut Pre-Stable PPA:

https://launchpad.net/~novacut/+archive/pre-stable

I'd love help testing the upgrade and that desktopcouch indeed works fine after the upgrade. All these packages will be pushed into to the Novacut Stable PPA this Thursday, December 29th.

Also, I revised my fix for desktopcouch:

https://code.launchpad.net/~jderose/desktopcouch/uri_file-fix/+merge/85431

I sort of forgot that desktopcouch doesn't write a new ~/.config/desktop-couch/desktop-couchdb.ini at each launch, so fixing that config file doesn't work when one already exists.

The correct solution was to deliver the config change in:

/etc/xdg/desktop-couch/default.ini

Revision history for this message
Evan Broder (broder) wrote :

Hi Jason -

In the future, I'd strongly encourage falling back to debdiffs instead of bzr branches when you run into this much trouble getting the bzr MPs to do what you want. I don't want to blame you for the tardiness of the review here - that's clearly a failure of the development and sponsorship teams - but I do think that a debdiff on this bug would have gotten more eyeballs than the MP in its current state.

After a lot of staring, though, I think I'm mostly satisfied with this change. I only really have one issue:

/etc/couchdb/local.ini and /etc/couchdb/local.d/ were moved from couchdb-bin to couchdb. This means that couchdb should probably Replace couchdb-bin (<= 1.0.1-0ubuntu18) in order to ensure a smooth upgrade. Does moving the file between packages trigger a conffile conflict if the user hasn't otherwise changed /etc/couchdb/local.ini?

It's a little unfortunate that couchdb-bin used to create the couchdb user/group and never bothered to clean them up on uninstall, but I think that may be a historical turd we'll have to live with.

Modulo the conffile conflict question, I'm satisfied with this. Jason, if you can add the missing Replaces, do some testing around that, and report back, I'd be happy to sponsor the change. I'm particularly interested to know whether the user is prompted on upgrade if they haven't changed the local.ini file.

Thanks for the contribution!

Revision history for this message
Evan Broder (broder) wrote :

Oh yeah - and because the merge proposal just makes my eyes bleed, I'm going to go ahead and attach the debdiff from Debian here and reject the MP. The useful discussion is here and not on the MP, and the MP doesn't accurately represent the patch anyway.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Evan,

Thanks for reviewing this! I'll add the Replaces and test out the conf file upgrade ASAP.

Sorry, I didn't know about debdif, thought I was doing this the appropriate Ubuntu way.

Yeah, the config file situation is a bit screwy. Moving local.ini and local.d into couchdb-bin might be a bit more invasive from the Ubuntu perspective, but my thought was that's probably a less invasive change from the Debian perspective, which is what I feel is important going forward.

Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in couchdb (Ubuntu):
status: New → Confirmed
Revision history for this message
Benjamin McGough (bmcgough) wrote :

Perhaps worth noting here that couchdb replication is broken with the current packages.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Benjamin - broken in what way? Overall I've had decent luck replicating with this version... in what scenario do you consider it broken? Do you happen to have links to upstream bugs that might be involved?

Thanks!

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Evan,

couchdb now Replaces couchdb-bin (<= 1.0.1-0ubuntu18). I tested the upgrade with the 1.0.1 couchdb and couchdb-bin packages installed, and the upgrade works without triggering a conffile conflict.

I attached an updated debdiff. Thanks again for the review!

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Evan,

Also, I was pretty darn careful testing the upgrade before too, so unless I missed an important permutation, it wasn't triggering a conffile conflict before the Replaces was added... or I just missed it.

Anyway, I guess the important thing is it isn't triggering it now with what (might) be the package to actually go into Precise.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Errr! Okay, one issue I just found, this is broken:

sudo /etc/init.d/couchdb stop

It's broken for both the version currently in Precise and my proposed version here.

In 1.0.1, `/etc/init.d/couchdb stop` says it fails and doesn't kill couchdb.

In my 1.1.1 package, `/etc/init.d/couchdb stop` seems to work fine, but couchdb is still running.

Not sure if this was the case under Oneiric or not. I'm wondering it's something to do with different Erlang versions perhaps.

Revision history for this message
Evan Broder (broder) wrote :

Jason: Have you made any progress on fixing the initscript? Also, at this point we really need to get a FFe for this change. Could you fill one out? (http://wiki.ubuntu.com/FreezeExceptionProcess lists the information that the release team will want to see - feel free to subscribe me to the new FFe bug, and I can take over once the release team approves it)

Revision history for this message
Benjamin McGough (bmcgough) wrote :

I was able to replicate between identical versions of couchdb on identical versions of Ubuntu. Don't know what was going on the first time, but I've been able to do it several times now.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Evan: no, haven't make any progress on this and unfortunately I wont have any time to for at least few weeks. However, I did confirm that the init.d script is working fine under Oneiric, for both the current Ubuntu version and my proposed version. I'm not sure why this is, but I guess it helps narrow down the search a bit.

Benjamin: thanks for testing the replication! In my experience, the replicator can be rather flakey/slow across the Internet (and will timeout often), but I've never had any issues replicating locally or without a local network.

Revision history for this message
Benjamin McGough (bmcgough) wrote : Re: [Bug 903098] Re: Please merge (sort of) couchdb 1.1.1-1 from Debian testing

It was replication across a longhaul link. It seems to be working now,
but it didn't work the first handful of time I tried it. Just timed
out with no good errors in the logs.

 I have not tried continuous replication, but I plan to.

Thanks,

-Ben

On Tue, Mar 6, 2012 at 3:45 PM, Jason Gerard DeRose <email address hidden> wrote:
> Evan: no, haven't make any progress on this and unfortunately I wont
> have any time to for at least few weeks.  However, I did confirm that
> the init.d script is working fine under Oneiric, for both the current
> Ubuntu version and my proposed version. I'm not sure why this is, but I
> guess it helps narrow down the search a bit.
>
> Benjamin: thanks for testing the replication! In my experience, the
> replicator can be rather flakey/slow across the Internet (and will
> timeout often), but I've never had any issues replicating locally or
> without a local network.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/903098
>
> Title:
>  Please merge (sort of) couchdb 1.1.1-1 from Debian testing
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/903098/+subscriptions

Revision history for this message
Jason Gerard DeRose (jderose) wrote :
Download full text (3.2 KiB)

Okay, I'm attempting this again, this time with CouchDB 1.2.0 aiming for Quantal.

I'm not sure what the best practice is here: should I update this bug title, or work from a new bug? I filed a new bug, but I'll mark it as a duplicate if needed:

https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/1022515

There are test packages available for Precise and Quantal in ppa:novacut/daily:

https://launchpad.net/~novacut/+archive/daily

And here's the packaging branch I'm working in:

https://code.launchpad.net/~jderose/ubuntu/quantal/couchdb/1.2.0-low-delta

As far as the core CouchDB app, I've had all the Novacut components running their unit tests against this 1.2.0 package, on both Quantal and Precise, with no test failures. So I feel that everything delivered in the `couchdb-bin` binary package is solid.

Where I have less confidence is the /etc/init.d/couchdb script, as the (CouchDB) upstream version is rather badly behaved, at least on Ubuntu. So I really need help further testing the `couchdb` binary package.

The upstream init.d script doesn't work when /var/run is on a tmpfs, but I patched it so that after /var/run/couchdb is created, a chown is done so it's owned by the "couchdb" user. Without this patch, the init.d script is totally broken.

The remaining, strange issue is for some reason you can't stop the daemon after the package install... but if you reboot, then it works. For example, this doesn't work:

sudo apt-get install couchdb
sudo /etc/init.d/couchdb stop

But this does work:

sudo apt-get install couchdb
<reboot>
sudo /etc/init.d/couchdb stop

The same issue exists in the current Ubuntu 1.0.1 package:

https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/1024924

For reference, here's my current 1.2.0 changelog:

couchdb (1.2.0-1ubuntu1) quantal; urgency=low

  * Started with branch of 1.2.0-1 from Debian unstable
  * Split into `couchdb-bin` and `couchdb` binary packages as found in Ubuntu,
    with goal of keeping delta between Debian and Ubuntu as low as possible
  * Changes from how the split is done in Ubuntu:
    - /etc/couchdb/default.ini and /etc/couchdb/default.d are delivered in the
      `couchdb-bin` package and are owned by root
    - /etc/couchdb/local.ini and /etc/couchdb/local.d are delivered in the
      `couchdb` package and are owned by the "couchdb" user
    - The `couchdb-bin` package does not create nor require the "couchdb" user
      (this is now done in the `couchdb` package instead)
  * Changes from Debian:
    - After couchdb.postinst runs, only /etc/couchdb/local.ini and
      /etc/couchdb/local.d are owned by the "couchdb" user, while the rest of
      /etc/couchdb remains owned by root
    - Patched /etc/init.d/couchdb so /var/run/couchdb is owned by the "couchdb"
      user, needed for the init.d script to actually work (var-run.patch)
    - Added a short sleep delay in couchdb.postrm so couchdb is more likely to
      have actually terminated by the time we `deluser couchdb`, which is needed
      for `sudo apt-get purge couchdb` to work when couchdb is running
    - Added couchdb-bin.postinst to fix permissions in /etc/couchdb after
      upgrading from the Ubuntu couchdb 1.0.1 package ...

Read more...

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Added new debdiff for couchdb_1.2.0-1 => couchdb_1.2.0-1ubuntu1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.