Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-11426

2/2 Olafs agree: changelog entries are emitted out of order

Details

    • 3
    • 9223372036854775807

    Description

      When storing changelogs we do not strictly order the entries with respect to index.

      int mdd_changelog_store(const struct lu_env *env, struct mdd_device *mdd,
                              struct llog_changelog_rec *rec, struct thandle *th)
      {
              ...
      
              /* llog_lvfs_write_rec sets the llog tail len */
              rec->cr_hdr.lrh_type = CHANGELOG_REC;
              rec->cr.cr_time = cl_time();
      
              spin_lock(&mdd->mdd_cl.mc_lock);
              /* NB: I suppose it's possible llog_add adds out of order wrt cr_index,
               * but as long as the MDD transactions are ordered correctly for e.g.
               * rename conflicts, I don't think this should matter. */
              rec->cr.cr_index = ++mdd->mdd_cl.mc_index;
              spin_unlock(&mdd->mdd_cl.mc_lock);
      
              ctxt = llog_get_context(obd, LLOG_CHANGELOG_ORIG_CTXT);
              if (ctxt == NULL)
                      return -ENXIO;
      
              llog_th = thandle_get_sub(env, th, ctxt->loc_handle->lgh_obj);
              if (IS_ERR(llog_th))
                      GOTO(out_put, rc = PTR_ERR(llog_th));
      
              /* nested journal transaction */
              rc = llog_add(env, ctxt->loc_handle, &rec->cr_hdr, NULL, llog_th);
      

      This may not be a bug in itself but it means that a changelog consumer must account for gaps in the sequence when clearing changelog entries.

      Attachments

        Issue Links

          Activity

            [LU-11426] 2/2 Olafs agree: changelog entries are emitted out of order
            chunteraa Chris Hunter (Inactive) made changes -
            Link New: This issue is related to DDN-881 [ DDN-881 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is duplicated by LU-12869 [ LU-12869 ]
            pjones Peter Jones made changes -
            Link Original: This issue is related to JFC-17 [ JFC-17 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to JFC-20 [ JFC-20 ]
            pjones Peter Jones made changes -
            Labels Original: LTS12 ORNL changelog hsm llnl New: ORNL changelog hsm llnl
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.12.3 [ 14418 ]

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36316/
            Subject: LU-11426 llog: changelog records reordering
            Project: fs/lustre-release
            Branch: b2_12
            Current Patch Set:
            Commit: 5c5a1e9b4839c3d6a70b3b7e768944f6dc237c2e

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36316/ Subject: LU-11426 llog: changelog records reordering Project: fs/lustre-release Branch: b2_12 Current Patch Set: Commit: 5c5a1e9b4839c3d6a70b3b7e768944f6dc237c2e

            I'm also applying LU-11617 which is a potential bug as well as the above patches. The reason for also including LU-12533 was so the patches applied cleanly to 2.12 LTS. If its not needed then thats fine

            simmonsja James A Simmons added a comment - I'm also applying LU-11617 which is a potential bug as well as the above patches. The reason for also including LU-12533 was so the patches applied cleanly to 2.12 LTS. If its not needed then thats fine
            pjones Peter Jones added a comment -

            Thanks James. The second patch looks like a nice performance improvement but I am not sure how this would relate to changelog correctness. Are you just listing all the patches that you are currently applying to b2_12 regardless of their relevance to this particular issue?

            pjones Peter Jones added a comment - Thanks James. The second patch looks like a nice performance improvement but I am not sure how this would relate to changelog correctness. Are you just listing all the patches that you are currently applying to b2_12 regardless of their relevance to this particular issue?

            We have also

            Lustre commit d7bb6647cd4dd26949bceb6a099cd606623aff2b ("LU-11626 mdc: hold obd while processing changelog")

            The other patch is LU-12533 but I don't know if that is more a feature or a fix so its not clear in that case.

             

            simmonsja James A Simmons added a comment - We have also Lustre commit d7bb6647cd4dd26949bceb6a099cd606623aff2b (" LU-11626 mdc: hold obd while processing changelog") The other patch is LU-12533 but I don't know if that is more a feature or a fix so its not clear in that case.  

            People

              qian_wc Qian Yingjin
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: