List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 11 2002 4:56pm
Subject:Re: take one database offline
View as plain text  
At 17:53 +1100 12/11/02, Stephen Brownlow wrote:
>Hello Paul,
>
>I am only lobbying, not demanding.

Sorry.  I wasn't trying to imply that you were demanding.
It's just that experience shows that feature implementation
always seems easy to the people who aren't doing the work. :-)

>
>Paul Dubois wrote:
>
>>  Mmm, how do you know how much effort it would be?
>>  Have you implemented it?
>
>Ok. IMHO it would be relatively easy for MySQL to implement, judging by my
>experience dealing with Monty and his source code (specifically, the myisam
>API).
>
>I await comments from MySQL AB.
>
>>  Write a client that flushes all the tables, then places a write lock
>>  on them all.  That will keep anyone else from modifying them.
>
>Will it stop mysqld from reading them?

Yes. When the client places the write lock, it's the server that grants
the lock request, so it knows that only the client that holds the lock
can make changes.  In the situation at hand, that client won't make any
changes; it's grabbing the lock only to prevent *other* clients from
making changes.

>Some maintenance processes such as myisamchk will actually move the files
>around, which could confuse mysqld.

That's why the client acquires a write lock and then doesn't make any
changes itself.

This is described in more detail in chapter 13 of that New Riders book.

>
>>  Run myisamchk.  When it's done, flush the tables again and unlock them.
>
>While that might be workable, don't you think the proposal would be both
>safer and simpler?

Sure.  But in the absence of that capability, the procedure described
might be useful in some way.

>
>Thanks,
>Stephen

Thread
take one database offlineMVC Corporation)4 Dec
  • re: take one database offlineEgor Egorov5 Dec
    • Re: take one database offlineRay5 Dec
Re: take one database offlineMartin Waite5 Dec
Re: take one database offlineStephen Brownlow11 Dec
  • Re: take one database offlinePaul DuBois11 Dec
  • Re: take one database offlineStephen Brownlow11 Dec
    • Re: take one database offlinePaul DuBois11 Dec
  • Re: take one database offlineMichael T. Babcock13 Jan