Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-236

Structs should be serialized in a consistent order

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.1
    • None
    • None

    Description

      As it stands right now, Ruby generated structs will be serialized in arbitrary order (due to storage of metadata in a hash). This leads to different binary encoding for the same struct values. Ideally, it should be the same for any two serializations of equivalent structs, and between languages if possible.

      The two approaches that seem to make the most sense are in lowest-to-highest field id order, and in IDL-defined order. What do people think of this idea, and which approach would be preferred?

      Attachments

        1. thrift-236-v7.patch
          13 kB
          Bryan Duxbury
        2. thrift-236-v6.patch
          12 kB
          Bryan Duxbury
        3. thrift-236-v5.patch
          11 kB
          Bryan Duxbury
        4. thrift-236-v4.patch
          7 kB
          Bryan Duxbury
        5. thrift-consistent-order-v3.patch
          6 kB
          Alexander Shigin
        6. thrift-consistent-order-v2.patch
          6 kB
          Alexander Shigin
        7. sort-fields.diff
          0.9 kB
          David Reiss
        8. thrift-consistent-order.patch
          4 kB
          Alexander Shigin
        9. thrift-236.patch
          6 kB
          Bryan Duxbury

        Issue Links

          Activity

            People

              shigin Alexander Shigin
              bryanduxbury Bryan Duxbury
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: