Issue with creating TTL Indexes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.11.5, 2.11.6
    • Component/s: None
    • None
    • Environment:
      Tested on Ubuntu with MongoDB 4.4.2, and Windows Server 2019 with MongoDB 4.4.1, 4.4.2 and 4.4.3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello,

      I am not able to create TTL Indexes from my C# code to Database 4.4.2 or 4.4.3. The code works file with version 4.4.1

      C# Driver is version 2.11.6.

      I can create no-TTL Indexes without any problem.

      Here is the part of my code:

      srUIndexes = Builders<SRUsage>.IndexKeys;
      srUIndexesAdd = new List<CreateIndexModel<SRUsage>>()
          {
              new CreateIndexModel<SRUsage>(srUIndexes.Ascending(x => x.Date), new CreateIndexOptions { ExpireAfter = new TimeSpan(30, 0, 0, 0) }),
          };
      await dbXen.srusages.Indexes.CreateManyAsync(srUIndexesAdd);
      

       
      Here is the error from MongoDB server:

      {"t":\{"$date":"2021-01-28T17:38:53.691+02:00"},"s":"W", "c":"NETWORK", "id":4615610, "ctx":"conn1","msg":"Failed to check socket connectivity","attr":\{"error":"The operation completed successfully."}}
      {"t":\{"$date":"2021-01-28T17:38:53.691+02:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn1","msg":"Interrupted operation as its client disconnected","attr":\{"opId":19}}
      {"t":\{"$date":"2021-01-28T17:38:53.691+02:00"},"s":"I", "c":"NETWORK", "id":22989, "ctx":"conn1","msg":"Error sending response to client. Ending connection from remote","attr":\{"error":{"code":6,"codeName":"HostUnreachable","errmsg":"Connection reset by peer"},"remote":"127.0.0.1:54579","connectionId":1}}
      {"t":\{"$date":"2021-01-28T17:38:53.691+02:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":\{"remote":"127.0.0.1:54579","connectionId":1,"connectionCount":1}}
      

        1. CreateIndexes.cs
          16 kB
          Nikolay Papunov

            Assignee:
            James Kovacs
            Reporter:
            Nikolay Papunov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: