INNER CODE UNIT · Go

invalidCursor

rwynn/gtm · gtm.go:571

func invalidCursor(err error) bool {
	var serverErr mongo.ServerError
	if errors.As(err, &serverErr) {
		// 43   : cursor not found
		// 11601: cursor interrupted
		// 136  : cursor capped position lost
		// 237  : cursor killed
		for _, code := range []int{43, 11601, 136, 237} {
			if serverErr.HasErrorCode(code) {
				return true
			}
		}
	}
	return false
}

func tailShards(multi *OpCtxMulti, ctx *OpCtx, o *Options, handler ShardInsertHandler) {
	defer multi.allWg.Done()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…