Opened 13 years ago

Last modified 12 years ago

#185 closed defect (WONTFIX)

Require mongodb v1.3+

Reported by: Caleb Davis Owned by:
Priority: trivial Milestone: 0.2.1
Component: programming Keywords:
Cc: Parent Tickets:


Alert the user to older versions of mongodb, and possibly exit
whatever was happening at the time.

Change History (14)

comment:1 by Caleb Davis, 13 years ago

so, where's the best place to do this check, since we don't really
have an

comment:2 by Christopher Allan Webber, 13 years ago

Owner: set to Elvenlord Elrond
mediagoblin/ MediaGoblinApp.**init** probably should call

It might be appropriate in mediagoblin/db/ also.

... I'm actually assigning this to Elrond, if he doesn't mind! I
think he'll be able to find a good space. We could raise an
exception like BadMongoVersion or something. I don't know :)

comment:3 by Elrond, 13 years ago

1. Directly in db/\_database\_from\_config().
2. In init/**init**.py:setup\_database().
   \* a) Either directly there, which isn't my favourite.
   \* b) or by calling some "check\_db\_is\_recent(db)" in db/
   (note the actual version isn't in the call! It's in db/

Option 1 is simple, straight forward and gets the job done.
Option 2 gives some parts the option to bypass the check by opening
the db connection directly using db/ (probably not
Option 1 and 2b "hide" the actual check away and thus are more
"other db backend future proof".

Any higher level ( doesn't make sense to me. For example
celery most likely also needs a recent enough version.

My vote is for 1), unless something needs to bypass the version
check and run anyway. What about mongodb upgrades? Do they need any
"help" by the apps?

Does that make sense?

comment:4 by Caleb Davis, 13 years ago

For now I added in the Hacking Howto
(` <>`_)
that v1.3+ is the MongoDB prereq.

If one is using Ubuntu, v10.10(Meerkat)+ is recommended for
compatibility with MediaGoblin. It's the first Ubuntu rev with a
v1.3+ mongodb (v1.4.4
-` <>`_)

That's the most compact, not scary way I could think of so far to
preemptively alert to this dependency. I feel like the above
paragraph should go in the hacking howto, but I'm not sure where to
put it.

comment:5 by Caleb Davis, 13 years ago

oh, nevermind. This makes more sense -
` <>`_

comment:6 by Christopher Allan Webber, 13 years ago

` <>`_

I don't think we should use that method for version comparison.. we
should use setuptools (distutils?)' version comparison tools.


    >>> from distutils.version import StrictVersion
    >>> StrictVersion('0.1.0') >= StrictVersion('0.0.5')

comment:7 by Elrond, 13 years ago

Owner: set to Elvenlord Elrond
I just realized, that this bug is assigned to me. I don't want to
block it! So if someone wants to handle it, do so! (removing
assigned to just now.)

That said, we still need to decide which way to go? 1 or 2b?
Do we ever need to bypass the version check? If not, I'd vote for
1. It's simple, straight forward, etc.

I have no particular idea on what Exception to raise, or what
exactly to do in the bad case.

comment:8 by Christopher Allan Webber, 13 years ago

Personally I think 2a) sounds best, but I'd leave it up to the
implementer to decide for sure. (We really need some logging

comment:9 by Elrond, 13 years ago

1. I dislike 2a) because it moves a db backend specific thing
   (needed version of **that** backend) into the main non backend
   code. I know, there's no other backend anywhere soon. Still I don't
   like that. And 1) is exactly as simple and hides it in the backend.
   That said, I leave the decision to the actual implementer too.
2. I think, ``StrictVersion`` might be a bad idea: From a quick
   look at ``help(StrictVersion)`` it seems to be very python specific
   (for example, two or three numbers only). And nobody knows how the
   mongodb version looks in the future. ``LooseVersion`` might be

comment:10 by Christopher Allan Webber, 13 years ago


comment:11 by Christopher Allan Webber, 12 years ago


comment:10 by Elrond, 12 years ago

Priority: NormalLow
We surely wont get his done for 0.2.0.
Setting "Low priority", as we've decided to try a move to SQL.

comment:11 by Christopher Allan Webber, 12 years ago

Status: NewRejected
Set to rejected.

There's no serious reason to invest the time in this anymore.

comment:12 by Will Kahn-Greene, 12 years ago

The original url for this bug was .
#170: related, #231: related

Note: See TracTickets for help on using tickets.