Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1977

Bad changeset due to untouched reciprocal history entry

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • None

      Our soak tests ran into a bad changeset in PBS performing the following series of events

      T1: client version 4996: local ArrayInsert to obj.intListField

      T2: client receives SV 6658: Clear obj.intListField

      • Expectation is that ArrayInsert @ 4996 is discarded when it merges against the Clear
      • Reciprocal history does not reflect this update, but realm data does

      T3: client receive SV 6723: ArrayInsert to obj.list

      • Results in a bad changeset due to a prior size mismatch
      • Theory is because reciprocal history @ 4996 does not reflect the discarded ArrayInsert

      Based on this it looks like the client is running OT and getting the correct output (as it gets applied to state properly), but the OT output is not being reflected in reciprocal history

       

      EVG Task

      • the relevant files for this repro are `device_4.realm` and `device_4.log` in `subsoakers.tgz` attached to this evergreen task
      • Object Primary Key: oid("0ca58574b6f0f0572e")
      • Array Field: `intListField`

       

      Relevant changesets from server history dump (Dump can be `mongorestore`d from __realm_sync.gz)

      // Changeset that the local change at T1 merged against
      { timestamp: 287415144155, _id: 65c629de298546c714dc15e2, createdAt: '2024-02-09 13:34:22 +0000 UTC', fileIdent: 3, clientVersion: 4736, serverVersion: 6658, instructions: [
               Update { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="_pKey"), payload: "hiwqwluokygetwkfmj", isDefault: false, priorSize: 0 },
               Clear { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld"), priorSize: 0 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.0"), payload: 3255124513315405, priorSize: 0 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.1"), payload: 1152914988180245, priorSize: 1 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.2"), payload: 8652981199148631, priorSize: 2 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.3"), payload: 5257082114615562, priorSize: 3 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.4"), payload: 4962132771478012, priorSize: 4 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.5"), payload: 610258687391357, priorSize: 5 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.6"), payload: 8030180275848615, priorSize: 6 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.7"), payload: 2692238070770941, priorSize: 7 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.8"), payload: 8389870175223855, priorSize: 8 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.9"), payload: 2550864430468186, priorSize: 9 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.10"), payload: 2448326381062568, priorSize: 10 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.11"), payload: 3920266420108281, priorSize: 11 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.12"), payload: 4748114750730776, priorSize: 12 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.13"), payload: 5290562076489202, priorSize: 13 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.14"), payload: 4763018075988447, priorSize: 14 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.15"), payload: 5558702512205115, priorSize: 15 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.16"), payload: 1470857233029320, priorSize: 16 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.17"), payload: 2414691363089715, priorSize: 17 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.18"), payload: 6136840945697697, priorSize: 18 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.19"), payload: 6240611872508867, priorSize: 19 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.20"), payload: 696600421386660, priorSize: 20 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.21"), payload: 3759166984809251, priorSize: 21 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.22"), payload: 6200379315555408, priorSize: 22 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.23"), payload: 3740818814444825, priorSize: 23 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.24"), payload: 5052040814781635, priorSize: 24 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a
      205"), fullPath="intListFld.25"), payload: 8632950791858863, priorSize: 25 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.26"), payload: 268386300614666, priorSize: 26 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.27"), payload: 7300284751995718, priorSize: 27 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.28"), payload: 4891235888437641, priorSize: 28 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.29"), payload: 4931806891077047, priorSize: 29 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.30"), payload: 59838987277831, priorSize: 30 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.31"), payload: 1391073917123324, priorSize: 31 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.32"), payload: 6926012470475492, priorSize: 32 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.33"), payload: 2566972138449680, priorSize: 33 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.34"), payload: 8381966378538948, priorSize: 34 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.35"), payload: 5199522972991873, priorSize: 35 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.36"), payload: 3893666273634272, priorSize: 36 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.37"), payload: 7564985999791688, priorSize: 37 },
      intListFld.26"), payload: 268386300614666, priorSize: 26 },
               Update { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="_pKey"), payload: "hiwqwluokygetwkfmj", isDefault: false, priorSize: 0 },
               Clear { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld"), priorSize: 0 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.0"), payload: 3255124513315405, priorSize: 0 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.1"), payload: 1152914988180245, priorSize: 1 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.2"), payload: 8652981199148631, priorSize: 2 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.3"), payload: 5257082114615562, priorSize: 3 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.4"), payload: 4962132771478012, priorSize: 4 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.5"), payload: 610258687391357, priorSize: 5 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.6"), payload: 8030180275848615, priorSize: 6 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.7"), payload: 2692238070770941, priorSize: 7 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.8"), payload: 8389870175223855, priorSize: 8 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.9"), payload: 2550864430468186, priorSize: 9 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.10"), payload: 2448326381062568, priorSize: 10 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.11"), payload: 3920266420108281, priorSize: 11 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.12"), payload: 4748114750730776, priorSize: 12 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.13"), payload: 5290562076489202, priorSize: 13 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.14"), payload: 4763018075988447, priorSize: 14 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.15"), payload: 5558702512205115, priorSize: 15 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.16"), payload: 1470857233029320, priorSize: 16 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.17"), payload: 2414691363089715, priorSize: 17 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.18"), payload: 6136840945697697, priorSize: 18 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.19"), payload: 6240611872508867, priorSize: 19 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.20"), payload: 696600421386660, priorSize: 20 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.21"), payload: 3759166984809251, priorSize: 21 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.22"), payload: 6200379315555408, priorSize: 22 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.23"), payload: 3740818814444825, priorSize: 23 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.24"), payload: 5052040814781635, priorSize: 24 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.25"), payload: 8632950791858863, priorSize: 25 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.26"), payload: 268386300614666, priorSize: 26 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.27"), payload: 7300284751995718, priorSize: 27 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.28"), payload: 4891235888437641, priorSize: 28 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.29"), payload: 4931806891077047, priorSize: 29 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.30"), payload: 59838987277831, priorSize: 30 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.31"), payload: 1391073917123324, priorSize: 31 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.32"), payload: 6926012470475492, priorSize: 32 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.33"), payload: 2566972138449680, priorSize: 33 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.34"), payload: 8381966378538948, priorSize: 34 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.35"), payload: 5199522972991873, priorSize: 35 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.36"), payload: 3893666273634272, priorSize: 36 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.37"), payload: 7564985999791688, priorSize: 37 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.38"), payload: 8428617618974834, priorSize: 38 },
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.39"), payload: 4842348580420880, priorSize: 39 },
               Update { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="linkField"), payload: RealmLink(table: "collRequiredLinked", key: ObjectID("01bfab61b060cd39cd577edf")), isDefault: false, priorSize: 0 },
        ]
      }
      
      // Changeset that triggered integration error
      { timestamp: 287415176158, _id: 65c629df298546c714dc16d1, createdAt: '2024-02-09 13:34:23 +0000 UTC', fileIdent: 3, clientVersion: 4873, serverVersion: 6723, instructions: [
               ArrayInsert { (table="collRequired", ID=ObjectID("7305fdbf077271adc079a205"), fullPath="intListFld.11"), payload: 7637604215384347, priorSize: 40 },
        ]
      } 

        1. repro_messages.txt
          58 kB
          Sean Brandenburg
        2. messages_668f2ef6e8ed03bf530574a7.txt
          1 kB
          Kiro Morkos
        3. history_dump.txt
          15 kB
          Sean Brandenburg
        4. device_2.parsed.log
          3.60 MB
          Sean Brandenburg

            Assignee:
            daniel.tabacaru@mongodb.com Daniel Tabacaru
            Reporter:
            sean.brandenburg@mongodb.com Sean Brandenburg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: