By default Index Scan timeout is 2min to avoid keeping indexer snapsot longtime which can impact cluster performance.
10 M records fetch takes time.
You can use different techniques.
- Use different queries and Pagination. May be keyset pagination https://blog.couchbase.com/offset-keyset-pagination-n1ql-query-couchbase/
- Use document keys through the N1QL and get the actual documents through SDKs.
- Increase Indexer timeout Index scan timed out