Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#3548 closed defect (bug) (duplicate)

Updating permalink structure crashes server

Reported by: skydrak Owned by: westi
Milestone: Priority: low
Severity: normal Version: 2.0.5
Component: Optimization Keywords:
Focuses: Cc:


If I write a static page the update procedure of the permalinks in the database kills my server. I have to restart the mysql server.

Currently over 1000 static pages.

Change History (8)

#1 @foolswisdom
11 years ago

Hi Skydrak,

Thank you for participating in WordPress! I also see you posted this issue to the forums with no response.

Can you please provide more details. What version of WordPress? Can you provide the steps I would do to duplicate the problem? What update procedure are you referring to?

#2 @Otto42
11 years ago

There was some discussion on it here too: http://wordpress.org/support/topic/99953

I'm not entirely familiar with the way rewriting works (I was highly confused when posting to that thread, and how I thought it worked was wrong), but they're talking about having 1000+ static pages in that thread. From what I can see, the problem could be something in the page_rewrite_rules() function, due to the fact that it has to do this huge loop of array merges and generate_rewrite_rules and so forth, for everything in page_uris.

Of course, having that many static pages is definitely an edge case.

#3 @foolswisdom
11 years ago

Otto42, thank you so much! Those are the essential questions and details to understand the problem!

#4 @westi
11 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

I have some ideas for this.

I think we can probably use a catchall rewrite for pages as long as certain types of rewrite tag are not at the begining of the permalink. For example category,postname,author at start all could clash with a postname catchall.

I will have a dig unless someone beats me.

#5 follow-up: @markjaquith
11 years ago

Sounds good in theory. Is your plan to keep the existing verbose page matching rules if the permalink structure starts with one of (category, postname, author) ?

We could allow for ambiguous URLs, but we'd have to issue an additional query to disambiguate. For example, with /%author%/%postname%/, we would have to do a query for author = firstthing AND post_name = secondthing and then query for a page path. Don't know if that's worth it. We'd then also have to worry about duplicate URLs (a page name that matches an author name). Probably more trouble than it is worth.

But yeah, go ahead and take a shot at it.

#6 in reply to: ↑ 5 @westi
11 years ago

Replying to markjaquith:

Sounds good in theory. Is your plan to keep the existing verbose page matching rules if the permalink structure starts with one of (category, postname, author) ?

Sort of. That is my plan for a first pass. We could also decide if pagecount > count of root permalink item to go verbose for category/postname/author

#7 @foolswisdom
11 years ago

  • Milestone changed from 2.2 to 2.3

#8 @rob1n
11 years ago

  • Milestone 2.3 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.