Deleting old pads

900 views
Skip to first unread message

Jens-Christian Fischer

unread,
Jan 5, 2010, 8:36:53 AM1/5/10
to etherpad
Hi there

is/was there ever a way to delete old / unused pads or were they just piling up in the database?


thanks
Jens-Christian


Chris Ball

unread,
Jan 5, 2010, 11:36:48 AM1/5/10
to etherpad-open-...@googlegroups.com
Hi,

> is/was there ever a way to delete old / unused pads or were they
> just piling up in the database?

etherpad/src/etherpad/pad/dbwriter.js:taskCheckForStalePads().

writePadNow(pad, true); does the deletion.

- Chris.
--
Chris Ball <c...@laptop.org>
One Laptop Per Child

mijo

unread,
Jan 5, 2010, 4:27:01 PM1/5/10
to EtherPad Open Source Discussion
Hi Jens,

the function identified by Chris seems to be some kind of garbage
collection to clean up the memory. There seems to be no modification
of the database. I found many of the corresponding entries in my
logfile - but my pads are still accessable.

Reading the faq-entry at etherpad.com (http://etherpad.com/ep/about/
faq#lifetime) I would not hope for any code to terminate pads. As far
as I understand the software by now, you have to remove the pads from
the database. I'm still trying to understand, which tables are
affected.

Regards from Germany

Michael


Chris Ball schrieb:

Daniel Reeves

unread,
Mar 2, 2010, 5:59:50 PM3/2/10
to etherpad-open-...@googlegroups.com
I wanted to resurrect this thread to see if anyone has worked out the
SQL magic to obliterate a pad.
What would happen if I just deleted the appropriate row from PAD_SQLMETA like
delete from PAD_SQLMETA where id = padidontwant;

(I'm afraid to try that on my etherpad instance.)

Joe Corneli

unread,
Mar 3, 2010, 4:50:30 AM3/3/10
to etherpad-open-...@googlegroups.com
> (I'm afraid to try that on my etherpad instance.)

How hard is it to set up several etherpad instances
running on the same machine...

John McLear

unread,
Mar 3, 2010, 10:55:16 AM3/3/10
to etherpad-open-...@googlegroups.com
Try it?

Daniel Reeves

unread,
Mar 5, 2010, 12:42:21 AM3/5/10
to etherpad-open-...@googlegroups.com
A related question: What is the SQL (and perhaps search&replace)
magic to rename a pad? (You could of course just create a new one and
copy-paste, but that would lose the history and colors.) This would
be about as good as deleting a pad since you could rename foo to
trash-foo and have foo be a blank slate with no history. Also, no
worries about someone stumbling on trash-foo (especially if you made
it trash-foo-somerandomstring).

dd

unread,
Mar 10, 2010, 9:26:54 AM3/10/10
to EtherPad Open Source Discussion
i did this:

add this to trunk/etherpad/src/etherpad/control/pad/pad_control.js :
function render_delete_post() {
var localPadId = request.params.padIdToDelete;

model.accessPadGlobal(localPadId, function(pad) {
collab_server.bootUsersFromPad(pad, "deleted");
pad.destroy();
});
dbwriter.taskFlushPad(localPadId, "delete");

response.redirect(request.params.returnPath);
}

then in html, you can do:

<form action="/ep/pad/delete" method="post" id="delete-pad">
<input type="hidden" name="returnPath" value="<%= request.url %>" />
<input id="padIdToDelete" name="padIdToDelete" type="hidden" value="<
%=THE_PAD_ID %>" />
<input type="submit" value="delete"/>
</form>


On Mar 5, 12:42 am, Daniel Reeves <dree...@gmail.com> wrote:
> A related question:  What is the SQL (and perhaps search&replace)
> magic to rename a pad?  (You could of course just create a new one and
> copy-paste, but that would lose the history and colors.)  This would
> be about as good as deleting a pad since you could rename foo to
> trash-foo and have foo be a blank slate with no history.  Also, no
> worries about someone stumbling on trash-foo (especially if you made
> it trash-foo-somerandomstring).
>
>
>
> On Tue, Mar 2, 2010 at 5:59 PM, Daniel Reeves <dree...@gmail.com> wrote:
> > I wanted to resurrect this thread to see if anyone has worked out the
> > SQL magic to obliterate a pad.
> > What would happen if I just deleted the appropriate row from PAD_SQLMETA like
> >  delete from PAD_SQLMETA where id = padidontwant;
>
> > (I'm afraid to try that on my etherpad instance.)
>

John McLear

unread,
Mar 10, 2010, 12:32:37 PM3/10/10
to EtherPad Open Source Discussion
2 things:

1) Would it be possible to make the function redirect the user back
to the "Pad selection screen"?
2) How are you obtaining THE_PAD_ID if the PAD_ID value is a pro
account (IE prefixed)

John McLear

unread,
Mar 10, 2010, 12:50:42 PM3/10/10
to EtherPad Open Source Discussion
Also I added

<form action="/ep/pad/delete" method="post" id="delete-pad">
<input type="hidden" name="returnPath" value="<%= request.url %>" />
<input id="padIdToDelete" name="padIdToDelete" type="hidden"

value="< %=localPadId %>" />
<input type="submit" value="delete pad"/>
</form>

to pad_body2.ejs

and

function render_delete_post() {
var localPadId = request.params.padIdToDelete;
model.accessPadGlobal(localPadId, function(pad) {
collab_server.bootUsersFromPad(pad, "deleted");
pad.destroy();
});
dbwriter.taskFlushPad(localPadId, "delete");
response.redirect(request.params.returnPath);
}

to trunk/etherpad/src/etherpad/control/pad/pad_control.js

I then created a new pad and tried to delete it (using the button) but
I got an error when it tried to load the page:

http://primarypad2.com/ep/pad/delete

404 not found: /ep/pad/delete

Have you missed a step out?

Thanks, J

dd

unread,
Mar 15, 2010, 9:40:15 PM3/15/10
to EtherPad Open Source Discussion
i did this just for public pads, not pro pads

I've also stopped using etherpad after this experiment, so I probably
wont have any more info

Reply all
Reply to author
Forward
0 new messages