Always stale 3.0 30151

90 views
Skip to first unread message

Derek den Haas

unread,
Oct 19, 2016, 10:00:55 AM10/19/16
to RavenDB - 2nd generation document database
My ID's are formed using logic Suppliers/<EAN of supplier>

1 of my import scripts was adding "Suppliers/12345          " <-- with spaces (due to a manufacturer using an old fashioned database (using fixed 'column' sizes). These documents are visible in the studio but cannot be opened NOR deleted. If there is a reference to this id, also the indexes remain stale. To me this looks like a big issue.

To sum it up:
- Ability to add document with ID containing trailing spaces (I think only possible using bulkInsert)
- Not able to open nor delete this document using studio (I found myself stuck with a couple of documents that cannot be removed)
- If referenced in an indexed, this will make your CPU spike to 100%, fill up all memory and always remain stale (I think because it cannot find the document)
- Also, when replicating, RavenDB will strip the spaces from the ID, so if it's designed to withstand trailing spaces, please leave those spaces alone ;)

Before someone is shouting "you shouldn't add documents with trailing spaces", I would like to say: this isn't "Safe by default".

Derek den Haas

unread,
Oct 19, 2016, 10:01:41 AM10/19/16
to RavenDB - 2nd generation document database
A minor second question. Any suggestions on how to delete those documents besides replicating it to another database and back...

Op woensdag 19 oktober 2016 16:00:55 UTC+2 schreef Derek den Haas:

Felipe Leusin

unread,
Oct 19, 2016, 10:37:57 AM10/19/16
to RavenDB - 2nd generation document database
Have you tried deleting them just using the key: session.Delete(id) ?

Derek den Haas

unread,
Oct 19, 2016, 10:49:19 AM10/19/16
to RavenDB - 2nd generation document database
But when it does strip spaces, I will lose my newly inserted supplier without added trailing spaces ;) The documents now exists 2 times, one time with spaces, one without... Think it's best to create a new Test database ;). But still, hopefully they will solve this problem.

Op woensdag 19 oktober 2016 16:37:57 UTC+2 schreef Felipe Leusin:

Oren Eini (Ayende Rahien)

unread,
Oct 20, 2016, 3:14:33 AM10/20/16
to ravendb
You can run a Scripted Patch that would do that.
Inline image 1

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek den Haas

unread,
Oct 24, 2016, 4:38:04 AM10/24/16
to RavenDB - 2nd generation document database
PUT attempted on document 'suppliers/Import/1' using a non current etag (document deleted)
Patch failed (btw, this is 'suppliers/Import/1           ')

Op donderdag 20 oktober 2016 09:14:33 UTC+2 schreef Oren Eini:
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Derek den Haas

unread,
Oct 24, 2016, 5:16:03 AM10/24/16
to RavenDB - 2nd generation document database
 ---> System.NotSupportedException: Deleting documents is not supported.
 

Op maandag 24 oktober 2016 10:38:04 UTC+2 schreef Derek den Haas:

Oren Eini (Ayende Rahien)

unread,
Oct 25, 2016, 2:38:24 AM10/25/16
to ravendb
What is the script you used?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Oct 25, 2016, 2:38:38 AM10/25/16
to ravendb
Also, Defer should probably work, too

Derek den Haas

unread,
Oct 25, 2016, 5:07:27 AM10/25/16
to RavenDB - 2nd generation document database
Any script won't work, and gives the above error, because bulkinsert also inserted "suppliers/import/", now ravenDB assumes this document is "Suppliers/Import/1", but that one doesn't exists.

With the DeleteDocument(__document_id) I will get the error above, on any collection in 3.0 30151. So loads of "shit" entered the database using BulkInsert that shouldn't be added. 

Op dinsdag 25 oktober 2016 08:38:38 UTC+2 schreef Oren Eini:

Idan Haim

unread,
Oct 25, 2016, 8:23:45 AM10/25/16
to RavenDB - 2nd generation document database
Derek Hi 
I checked the issue and your right about the bulk insert this is a bug 
will be fixed

for deleting those file you have to replicating it to another database and back...
only the ones without the spaces then delete the old database and open a new one.


Derek den Haas

unread,
Oct 31, 2016, 4:14:23 AM10/31/16
to RavenDB - 2nd generation document database
There was also an issue being able to insert:

"Suppliers/"

Also a document which can't be removed, and when opened it will automatically go to Suppliers/1. It will also make your indexes hang, because of the redirect to /1.

Op dinsdag 25 oktober 2016 14:23:45 UTC+2 schreef Idan Haim:

Oren Eini (Ayende Rahien)

unread,
Oct 31, 2016, 7:51:42 AM10/31/16
to ravendb
What do you mean, indexes hang?
While this is an issue, which we'll fix, it shouldn't cause any other problems except with the studio.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
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+unsubscribe@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Oct 31, 2016, 7:52:11 AM10/31/16
to ravendb

Derek den Haas

unread,
Oct 31, 2016, 11:19:11 AM10/31/16
to RavenDB - 2nd generation document database
When "suppliers/import/"  (a document added by batchInsert, with / at end) enters the database (this was possible using BatchInsert), the Studio can't open it nor delete it. Also my index gets stuck with this ID, not the index of suppliers, but an index as follows:

from a in articles
let supplier = LoadDocument<Supplier>(a.SupplierId)
...

But I think it was the trigger of the added Suppliers/Import/ which will be added over and over again (maybe because RavenDB still thinks it's Suppliers/Import/1).

Since your fix only strips spaces, this is still a valid scenario that I think shouldn't enter the database OR should act as normal.

Op maandag 31 oktober 2016 12:52:11 UTC+1 schreef Oren Eini:
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Derek den Haas

unread,
Oct 31, 2016, 11:22:15 AM10/31/16
to RavenDB - 2nd generation document database
P.s. the whole thread was around this problem, might also have something to do with replication, which I don't know at the moment (might think it needs to replicate this document time after time, which means it will index it time after time). 

I'm sorry to say, but currently I got no extra time to investigate this further. Though I wanted to share this issue

Op maandag 31 oktober 2016 16:19:11 UTC+1 schreef Derek den Haas:
Reply all
Reply to author
Forward
0 new messages