Raven 3.5 possibility to programmatically checking for index corruption.

45 views
Skip to first unread message

jffef

unread,
Mar 5, 2021, 6:33:06 AM3/5/21
to RavenDB - 2nd generation document database
Hello. I am using RavenDB 3.5 and can not upgrade. From time to time indexes become corrupt and I have to reset them. It's presently a manual process to reset those corrupt indexes and I would like to automate this.

Is there, in 3.5, a programmatic way to determine if any indexes are corrupt? If it's relevant Raven is running in IIS.

Egor Shamanaev

unread,
Mar 8, 2021, 3:37:04 AM3/8/21
to rav...@googlegroups.com

On Fri, Mar 5, 2021 at 1:33 PM jffef <abaci...@gmail.com> wrote:
Hello. I am using RavenDB 3.5 and can not upgrade. From time to time indexes become corrupt and I have to reset them. It's presently a manual process to reset those corrupt indexes and I would like to automate this.

Is there, in 3.5, a programmatic way to determine if any indexes are corrupt? If it's relevant Raven is running in IIS.

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/07f64385-5649-4f38-834a-47f1e9d3cd72n%40googlegroups.com.


--
Egor
Developer   /   Hibernating Rhinos LTD
Support:  sup...@ravendb.net
  

jffef

unread,
Mar 8, 2021, 8:27:23 PM3/8/21
to RavenDB - 2nd generation document database
Hi Egor. Thank you for answering. IndexingErrors > 0 is not the same as a corrupted index though, right? Is there a way to provoke index corruption so I can test my monitor?

Egor Shamanaev

unread,
Mar 9, 2021, 3:17:07 AM3/9/21
to rav...@googlegroups.com
Hi 

In 4.2 you can try to divide some property by zero (ie:  order.Lines.Sum(l => (l.Quantity * l.PricePerUnit) * (1 - l.Discount)) / 0) this will throw index errors, could work in 3.5 as well.

jffef

unread,
Mar 9, 2021, 3:58:10 PM3/9/21
to RavenDB - 2nd generation document database
Thank you again for your time/response.

I tried to do what you suggest in 3.5. When I edit an index definition with a new property, say Jeff = 1/0, it throws an exception and refuses to save the index. Error CS0020 - Division by constant zero

Also could you clarify what, in 3.5, marks an index as corrupted? What is the relationship to the # of indexing errors etc? I can't treat 1 error as the index being corrupted.

Oren Eini (Ayende Rahien)

unread,
Mar 10, 2021, 5:28:48 AM3/10/21
to ravendb
You need to be a slight smarter about it.

Jeff = 1 / Convert.ToInt32("0")

To trick the compiler

jffef

unread,
Mar 10, 2021, 3:54:54 PM3/10/21
to RavenDB - 2nd generation document database
Thanks, I will try to be smarter in the future.

Is there any answer to this: "Also could you clarify what, in 3.5, marks an index as corrupted? What is the relationship to the # of indexing errors etc? I can't treat 1 error as the index being corrupted." Does the capability for checking for index corruption programmatically not exist in 3.5?

Reply all
Reply to author
Forward
0 new messages