2

I have a Raven database that I'm querying like this:

var query = Session
    .Query<Vehicle, VehicleWithReadyStatusIndex>()
    .Statistics(out queryStatistics)
    .TransformWith<VehicleWithDriver, VehicleWithDriver.Result()
    .Skip(skip)
    .Take(take);

Intermittently, enumerating this IQueryable results in an exception. I'm pretty sure it's a problem with the transformer. When it fails, I'd like to be able to see which documents were returned by the query against the VehicleWithReadyStatusIndex, in order to see which documents the transformer attempted to operate on. Being able to see that in a log or something could help me confirm what I believe to be the problem (the transformer attempting to operate on bad data).

In looking at my Raven log, which is set to the Trace level (although I don't see any Trace messages...hmmm), it tells me when the index is queried, and the number of results, but it'd be great if I could also get it to give me a list of the id's of all the documents it's returning (and sending along to the transformer) as well. Does anyone know of a way to do that?

Edit:

To clarify, I had already found a way to modify my transformer that fixes my original problem (an exception upon enumeration of the IQueryable). However, in spite of no longer getting the exception, there is still behavior that, while I can live with it, makes me think I'm not getting the full picture. In asking this question, I really only wanted to find out if there's any way to go back in time and see what the contents of an index were at the moment of a given query against it, whether in the logs or some other way of which I'm unaware. So far, sounds like the answer is "no".

In order to answer the questions behind this question, I would need to provide a good deal more context, and it would probably be best to put it in a different SO question entirely.

1 Answer 1

1

You can just run the query again, without the transformer, to get a hold of your input.

3
  • Thanks @Ayende, but I've tried that. The failure is related to timing and index updates, so I can't simply wait for a failure to occur and then go back to run the same query again--it wouldn't be the same query. I've tried simply running an identical query, minus the transformer, right before this query and inspecting the results to see the input the transformer is likely to get, but when I insert that extra code, I can no longer reproduce the original error. I'll edit my question for clarification, but I take it there's no way to change the log settings to get what I need in the Raven logs? Feb 6, 2015 at 15:19
  • 1
    Use full debug log, it will tell you the ids of the results. The results should be: 2015-02-06T21:10:11.6486562Z;DEBUG;Northwind;Raven.Database.Indexing.Index.Querying;Issuing query on index 3 for: Company: companies/85 2015-02-06T21:10:11.6486562Z;DEBUG;Northwind;Raven.Database.Storage.Voron.StorageActions.DocumentsStorageActions;DocumentByKey() by key ='orders/1' 2015-02-06T21:10:11.6486562Z;DEBUG;Northwind;Raven.Database.Storage.Voron.StorageActions.DocumentsStorageActions;DocumentByKey() by key ='orders/27' Feb 6, 2015 at 21:10
  • Cool, thank you. I'm accepting your answer based on the additional information in your comment. Feb 8, 2015 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.