Skip to content

Fix deletion of redirected URLs - #2050

Open
Atmuri-SatyaPrakash wants to merge 2 commits into
apache:mainfrom
Atmuri-SatyaPrakash:fix-delete-redirected-pages
Open

Fix deletion of redirected URLs#2050
Atmuri-SatyaPrakash wants to merge 2 commits into
apache:mainfrom
Atmuri-SatyaPrakash:fix-delete-redirected-pages

Conversation

@Atmuri-SatyaPrakash

Copy link
Copy Markdown

Description

Fixes deletion of URLs that are redirected.

When a URL receives a REDIRECTION status, the URL was previously not emitted to the deletion stream. This could leave the old URL in the index after it redirects to another URL.

This change emits REDIRECTION statuses to the deletion stream while preserving the existing ERROR behavior.

Testing

Added a regression test to verify that redirected URLs are emitted to the deletion stream.

Tested with:

mvn -pl core -Deditorconfig.skip=true -Dtest=AbstractStatusUpdaterBoltTest test

Result:
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

@dpol1

Copy link
Copy Markdown
Member

@dpol1

Copy link
Copy Markdown
Member

Real gap, thanks - good regression test too.

Couple of questions:

  1. What happens with a temporary redirect? All 3xx end up as REDIRECTION, so a site doing a 302 during maintenance would get its doc deleted - and with the default schedule that delete re-fires daily. Should we limit this to 301/308 (via fetch.statusCode - though JSoup meta-refresh emits REDIRECTION with status 200), or make it opt-in via config for existing topologies?
  2. Since the ERROR branch got restructured, could we also assert ERROR still emits exactly one delete and FETCHED none? And does assertEquals(metadata, ...) actually test anything? Metadata has no equals(), so it's comparing the object with itself - maybe assert on a key instead.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Atmuri-SatyaPrakash@dpol1