我創建了一個帶有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
(偶爾,並不總是拋出是我的代碼錯