我创建了一个带有50M默认大小的封顶集合。最近,我注意到当封顶的集合存储大小超过50M时,出现Cursor not found
错误。我不确定是什么原因导致这种情况:在封顶收集大小小于默认最大大小之前,我从来没有收到过此错误。使用带有NoCursorTimeout的Tailable光标时出现'游标未找到'错误
if (this._cursor == null || this._cursor.IsDead)
{
var cursor = this._queueCollection.Find(Query.GT("_id", this._lastId))
.SetFlags(QueryFlags.AwaitData |
QueryFlags.TailableCursor |
QueryFlags.NoCursorTimeout)
.SetSortOrder(SortBy.Ascending("$natural"));
this._cursor =(MongoCursorEnumerator<QueueMessage<T>>)cursor.GetEnumerator();
}
try
{
if (this._cursor.MoveNext())
//do some things
return this._cursor.Current;
else
{
if (this._cursor.IsDead){
this._cursor.Dispose();
this._cursor=null;
}
}
return null;
}
catch{}
的this._cursor.MoveNext()将抛出一个异常cursor not found
(偶尔,并不总是抛出是我的代码错