> however,according to the log file, RavenDB thought there is no task to
> handle even the index is not refreshed and it's state is stale.
> Is there anything wrong with the task queue when data volume exceed some
> threshold?
Have you seen any errors or warnings in the log?
I can reproduce this state by randomly resetting indexes and already sent
Oren some code to reproduce this. Maybe it's the same issue.
In some cases I had a OOME logged and the indexing task just stopped while
the indexes are still stale.
Tobias
Debug 8/3/2012 1:35:53 PM No work was found, workerWorkCounter: 0, for: IndexingExecuter, will wait for additional work Raven.Database.Indexing.WorkContext
Debug 8/3/2012 1:35:53 PM No work was found, workerWorkCounter: 0, for: ReducingExecuter, will wait for additional work Raven.Database.Indexing.WorkContext
Debug 8/3/2012 1:34:46 PM Mapped result for index 'CensusBlock/PopulationTotalsByState' doc 'CensusBlockDocuments/370399306012027': '{ ... Raven.Database.Indexing.Index.Indexing
Debug 8/3/2012 1:34:46 PM Mapped result for index 'CensusBlock/PopulationTotalsByState' doc 'CensusBlockDocuments/370399304004060': '{ ... Raven.Database.Indexing.Index.Indexing
Debug 8/3/2012 1:34:46 PM Mapped result for index 'CensusBlock/PopulationTotalsByState' doc 'CensusBlockDocuments/370399304003059': '{ ... Raven.Database.Indexing.Index.Indexing
public class CensusBlockDocument
{
public CensusBlockDocument()
{}
public CensusBlockDocument(string fipsCode)
{
Id = "CensusBlockDocuments/" + fipsCode;
}
public string Id { get; set; }
public string FullFipsCode
{
get
{
if (Id.Contains("/"))
{
var split = Id.Split('/');
if (split.Length > 1)
{
return split[1];
}
return split[0];
}
return Id;
}
}
public DateTimeOffset Created { get; set; }
public string StateFipsId { get; set; }
public string CountyFipsId { get; set; }
public int HousingUnits { get; set; }
public int Population { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
public class CensusBlock_PopulationTotalsByStateAndCounty : AbstractIndexCreationTask<CensusBlockDocument, CensusBlock_PopulationTotalsByStateAndCounty.Result>
{
public class Result
{
public string StateFipsId { get; set; }
public string CountyFipsId { get; set; }
public int Population { get; set; }
public int HousingUnits { get; set; }
public int BlockCount { get; set; }
}
public CensusBlock_PopulationTotalsByStateAndCounty()
{
Map = cbds => from cbd in cbds
select new
{
StateFipsId = cbd.StateFipsId,
CountyFipsId = cbd.CountyFipsId,
Population = cbd.Population,
HousingUnits = cbd.HousingUnits,
BlockCount = 1
};
Reduce = result => from r in result
group r by new { r.StateFipsId, r.CountyFipsId }
into g
select new
{
CountyFipsId = g.Key.CountyFipsId,
StateFipsId = g.Key.StateFipsId,
Population = g.Sum(x => (int)x.Population),
HousingUnits = g.Sum(x => (int)x.HousingUnits),
BlockCount = g.Sum(x => (int)x.BlockCount)
};
Index(x => x.CountyFipsId, FieldIndexing.NotAnalyzed);
Index(x => x.StateFipsId, FieldIndexing.NotAnalyzed);
Store(x => x.CountyFipsId, FieldStorage.Yes);
Store(x => x.StateFipsId, FieldStorage.Yes);
}
}
public class CensusBlock_PopulationTotalsByState : AbstractIndexCreationTask<CensusBlockDocument, CensusBlock_PopulationTotalsByState.Result>
{
public class Result
{
public string StateFipsId { get; set; }
public int Population { get; set; }
public int HousingUnits { get; set; }
public int BlockCount { get; set; }
}
public CensusBlock_PopulationTotalsByState()
{
Map = cbds => from cbd in cbds
select new
{
StateFipsId = cbd.StateFipsId,
Population = cbd.Population,
HousingUnits = cbd.HousingUnits,
BlockCount = 1
};
Reduce = result => from r in result
group r by new {r.StateFipsId}
into g
select new
{
StateFipsId = g.Key.StateFipsId,
Population = g.Sum(x => (int) x.Population),
HousingUnits = g.Sum(x => (int) x.HousingUnits),
BlockCount = g.Sum(x => (int) x.BlockCount)
};
}
}
Hm,It is possible that what is happening is that it is busy reducing something?
Can you try to break into the process and see what it is doing?