Max number of params reduce

100 views
Skip to first unread message

npet...@directworks.com

unread,
Feb 9, 2016, 3:14:22 PM2/9/16
to RavenDB - 2nd generation document database
Is there a max number of params that can be specified in the reduce when creating an index? I am using the most currently available release.

Oren Eini (Ayende Rahien)

unread,
Feb 9, 2016, 3:14:56 PM2/9/16
to ravendb
I don't understand the question

Hibernating Rhinos Ltd  

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

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

 


On Tue, Feb 9, 2016 at 10:12 PM, <npet...@directworks.com> wrote:
Is there a max number of params that can be specified in the reduce when creating an index? I am using the most currently available release.

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

npet...@directworks.com

unread,
Feb 9, 2016, 5:06:12 PM2/9/16
to RavenDB - 2nd generation document database

I have a reduce that contains 454 fields.  

from result in results
group result by result.x into output
select new
{
  a  = x.key,
  ... 453 other fields
}

When I add a 455th field to the reduce, I am getting the following error in the Logs: 
Message
Failed to index documents for index: Quoting

Exception
System.InvalidOperationException: MSIL instruction is invalid or index is out of bounds.
   at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, LocalBuilder local)
   at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator, Int32 argsIndex)
   at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateParametrizedConstructor(MethodBase method)
   at Raven.Imports.Newtonsoft.Json.Serialization.JsonObjectContract.set_ParametrizedConstructor(ConstructorInfo value)
   at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
   at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
   at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
   at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Raven.Imports.Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Raven.Database.Indexing.MapReduceIndex.GetMappedData(Object doc)
   at Raven.Database.Indexing.MapReduceIndex.ProcessBatch(AbstractViewGenerator viewGenerator, List`1 currentDocumentResults, String currentKey, HashSet`1 changes, IStorageActionsAccessor actions, IDictionary`2 statsPerKey, Stopwatch reduceDuringMapLinqExecution, Stopwatch putMappedResultsDuration, Stopwatch convertToRavenJObjectDuration)
   at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClassb2.<>c__DisplayClassb7.<IndexDocuments>b__9f(IStorageActionsAccessor accessor)
   at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action)
   at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClassb2.<IndexDocuments>b__9e(IEnumerator`1 partition)
   at Raven.Database.Indexing.DefaultBackgroundTaskExecuter.ExecuteAllBuffered[T](WorkContext context, IList`1 source, Action`1 action)
   at Raven.Database.Indexing.MapReduceIndex.IndexDocuments(AbstractViewGenerator viewGenerator, IndexingBatch batch, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token)
   at Raven.Database.Indexing.IndexStorage.Index(Int32 index, AbstractViewGenerator viewGenerator, IndexingBatch batch, WorkContext context, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token)
   at Raven.Database.Indexing.IndexingExecuter.IndexDocuments(IStorageActionsAccessor actions, IndexingBatchForIndex indexingBatchForIndex, CancellationToken token)
   at Raven.Database.Indexing.IndexingExecuter.<>c__DisplayClass3e.<HandleIndexingFor>b__3a(IStorageActionsAccessor actions)
   at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action, EsentTransactionContext transactionContext)
   at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action)
   at Raven.Database.Indexing.IndexingExecuter.HandleIndexingFor(IndexingBatchForIndex batchForIndex, Etag lastEtag, DateTime lastModified, CancellationToken token)

This doesn't seem to be a problem on my colleague's instance of Raven. They are running version server build #3660 and client build #3660.
I am running server build #30037 and client build #30037.

Is there a limit to the number of fields that can be defined in a reduce?

Oren Eini (Ayende Rahien)

unread,
Feb 9, 2016, 5:18:49 PM2/9/16
to ravendb
No, there isn't such a limit although I do wonder about the kind of reduction you are making here.

What kind of index is that?

Also, can you check what version of the runtime you have there? 

npet...@directworks.com

unread,
Feb 10, 2016, 9:28:06 AM2/10/16
to RavenDB - 2nd generation document database
It's an index that is bringing together a couple of documents.

My runtime is 4.5.2.

Oren Eini (Ayende Rahien)

unread,
Feb 10, 2016, 9:28:57 AM2/10/16
to ravendb
And the other guy's runtime?

npet...@directworks.com

unread,
Feb 10, 2016, 11:22:29 AM2/10/16
to RavenDB - 2nd generation document database
4.5.2 as well

Oren Eini (Ayende Rahien)

unread,
Feb 10, 2016, 2:46:08 PM2/10/16
to ravendb
Can you send us a way to reproduce this?

sidya...@directworks.com

unread,
Mar 27, 2017, 3:27:47 PM3/27/17
to RavenDB - 2nd generation document database
Hi Oren, 

I get this error "MSIL instruction is invalid or index is out of bounds." after I tried to upgrade RavenDB server to the latest version which is v3.5.3.

Is there a way I can send you my database dump so that you can try to reproduce this error?

Oren Eini (Ayende Rahien)

unread,
Mar 27, 2017, 3:30:53 PM3/27/17
to ravendb
You can send it to sup...@ravendb.net, yes
But that error is something that I don't believe that we have seen. Do you have the _exact_ text plus full stack trace?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

sidya...@directworks.com

unread,
Mar 27, 2017, 3:34:13 PM3/27/17
to RavenDB - 2nd generation document database
This is the stack trace I got from the log.

Failed to index 159 documents for index: Quoting (id: 40). Skipping this batch (it won't be indexed)

System.InvalidOperationException: MSIL instruction is invalid or index is out of bounds. at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, LocalBuilder local) at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator, Int32 argsIndex) at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateParametrizedConstructor(MethodBase method) at Raven.Imports.Newtonsoft.Json.Serialization.JsonObjectContract.set_ParametrizedConstructor(ConstructorInfo value) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type) at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Raven.Imports.Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Raven.Json.Linq.RavenJToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer) at Raven.Json.Linq.RavenJObject.FromObject(Object o, JsonSerializer jsonSerializer) at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClass7_4.<IndexDocuments>b__5(IStorageActionsAccessor accessor) at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClass7_1.<IndexDocuments>b__4(IEnumerator`1 partition) at Raven.Database.Impl.BackgroundTaskExecuter.RavenThreadPool.ExecuteSingleBatchSynchronously[T](IList`1 src, Action`1 action, String description, DocumentDatabase database) at Raven.Database.Impl.BackgroundTaskExecuter.RavenThreadPool.ExecuteBatch[T](IList`1 src, Action`1 action, DocumentDatabase database, Int32 pageSize, String description) at Raven.Database.Indexing.MapReduceIndex.IndexDocuments(AbstractViewGenerator viewGenerator, IndexingBatch batch, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token) at Raven.Database.Indexing.IndexStorage.Index(Int32 index, AbstractViewGenerator viewGenerator, IndexingBatch batch, WorkContext context, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token) at Raven.Database.Indexing.IndexingExecuter.IndexDocuments(IStorageActionsAccessor actions, IndexingBatchForIndex indexingBatchForIndex, CancellationToken token) at Raven.Database.Indexing.IndexingExecuter.<>c__DisplayClass34_0.<ExecuteIndexingBatch>b__0(IStorageActionsAccessor actions) at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action, EsentTransactionContext transactionContext) at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) at Raven.Database.Indexing.IndexingExecuter.ExecuteIndexingBatch(IndexingBatchForIndex batchForIndex, Etag lastEtag, DateTime lastModified, CancellationToken token)

28 minutes ago (03/27/17, 3:05pm)

Warn

Raven.Database.Indexing.Index.Indexing

Oren Eini (Ayende Rahien)

unread,
Mar 27, 2017, 3:42:17 PM3/27/17
to ravendb
Do you have any custom code in RavenDB (plugins, analyzers, etc)? 
If not, then you are probably looking at mismatched versions of the binaries and need to wipe the binaries and get them all from the same version
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

mbar...@directworks.com

unread,
Mar 27, 2017, 5:06:00 PM3/27/17
to RavenDB - 2nd generation document database
Thanks for your quick response.  One clarification.  First, as far as I know, no custom code in RavenDB.  We have not written any plugins or analyzers.

>>If not, then you are probably looking at mismatched versions of the binaries and need to wipe the binaries and get them all from the same version
Do you mean uninstall RavenDB and then resinstall?

Thanks for the clarification.
   Monica

Oren Eini (Ayende Rahien)

unread,
Mar 28, 2017, 4:17:41 AM3/28/17
to ravendb
Yes, that would do it, but make sure that you wipe the binaries directory of RavenDB when you do that to leave aside any old code
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

sidya...@directworks.com

unread,
Mar 29, 2017, 11:29:49 AM3/29/17
to RavenDB - 2nd generation document database
I completely uninstalled ravendb. I also made sure there is no RavenDB folder. I reinstalled the latest stable version 3.5.3. I got few errors (see below). Please suggest. Thanks, Sid

Error occured while executing RavenThreadPool task ; Database name: nexteerlocal ; Task queued at: 03/29/2017 15:24:43 ; Task Description: Reducing index Quoting up to etag 01000000-0000-0001-0000-000000003C00, for 4025 documents range 2048 to 3071 of 4025

System.InvalidOperationException: MSIL instruction is invalid or index is out of bounds. at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, LocalBuilder local) at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator, Int32 argsIndex) at Raven.Imports.Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateParametrizedConstructor(MethodBase method) at Raven.Imports.Newtonsoft.Json.Serialization.JsonObjectContract.set_ParametrizedConstructor(ConstructorInfo value) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) at Raven.Imports.Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type) at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Raven.Imports.Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Raven.Json.Linq.RavenJToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer) at Raven.Json.Linq.RavenJObject.FromObject(Object o, JsonSerializer jsonSerializer) at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClass7_4.<IndexDocuments>b__5(IStorageActionsAccessor accessor) at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) at Raven.Database.Indexing.MapReduceIndex.<>c__DisplayClass7_1.<IndexDocuments>b__4(IEnumerator`1 partition) at Raven.Database.Impl.BackgroundTaskExecuter.RavenThreadPool.<>c__DisplayClass38_0`1.<ExecuteBatch>b__0() at Raven.Database.Impl.BackgroundTaskExecuter.RavenThreadPool.RunThreadTask(ThreadTask threadTask) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Raven.Database.Impl.BackgroundTaskExecuter.RavenThreadPool.ExecuteBatch[T](IList`1 src, Action`1 action, DocumentDatabase database, Int32 pageSize, String description) at Raven.Database.Indexing.MapReduceIndex.IndexDocuments(AbstractViewGenerator viewGenerator, IndexingBatch batch, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token) at Raven.Database.Indexing.IndexStorage.Index(Int32 index, AbstractViewGenerator viewGenerator, IndexingBatch batch, WorkContext context, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token) at Raven.Database.Indexing.IndexingExecuter.IndexDocuments(IStorageActionsAccessor actions, IndexingBatchForIndex indexingBatchForIndex, CancellationToken token) at Raven.Database.Indexing.IndexingExecuter.<>c__DisplayClass34_0.<ExecuteIndexingBatch>b__0(IStorageActionsAccessor actions) at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action, EsentTransactionContext transactionContext) at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) at Raven.Database.Indexing.IndexingExecuter.ExecuteIndexingBatch(IndexingBatchForIndex batchForIndex, Etag lastEtag, DateTime lastModified, CancellationToken token)

3 minutes ago (03/29/17, 11:24am)

Error

Raven.Database.DocumentDatabase

Oren Eini (Ayende Rahien)

unread,
Mar 29, 2017, 2:06:38 PM3/29/17
to ravendb
Please share the index definition in question.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages