I am working on an e-commerce website, where users can create a new product to sell. When a user creates a new product, that new product gets an auto-incremented Id, let's say 25, so the link for the new product would be:
Now I have sitemap generator service which runs every one hour and rebuilds the sitemap. In this scenario,
mysite/products/25 would be added to the site map.
Let's assume after 10 days, the product is sold and the user deletes the product. Now if any client clicks on:
mysite/products/25 they will be redirect to home page and an informational alert appears on top of the page saying: this ad has been removed.
But this deleted link still exists in the sitemap (for several minutes) until the my sitemap generator service recreates the sitemap and remove the link of the deleted product.
What happens if Goolge (or any search engine) read the sitemap and try to reindex the page and gets redirect to home page? Would it negatively affect my website ranking? If so, how should I build the the dynamic sitemap to avoid this problem?