You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alexander Shigin (JIRA)" <ji...@apache.org> on 2008/07/15 14:13:31 UTC

[jira] Created: (THRIFT-84) fingerprint depend on appearence order, not field identifiers

fingerprint depend on appearence order, not field identifiers
-------------------------------------------------------------

                 Key: THRIFT-84
                 URL: https://issues.apache.org/jira/browse/THRIFT-84
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (General)
            Reporter: Alexander Shigin


The next two struct produce different fingerprints:

{code}
    struct Bonk
    {
      2: i32 type
      1: string message,
    }
    struct Bonk
    {
      1: string message,
      2: i32 type
    }
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-84) fingerprint depend on appearence order, not field identifiers

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss resolved THRIFT-84.
-------------------------------

    Resolution: Invalid

This is by design.  The serialization code serializes the fields in code order, rather than identifier order.  For the dense protocol, we have to make sure that we deserialize them in the proper order because we don't include the field tags.  Therefore, two structures that define fields in different orders have to have different fingerprints in order for the dense protocol to work.  We could modify the code generator to always serialize structures in identifier order instead of code order, but that would break backwards-compatibility with the dense protocol (if anyone is using structures with backwards-defined fields) and I'm not sure what the benefit would be.

> fingerprint depend on appearence order, not field identifiers
> -------------------------------------------------------------
>
>                 Key: THRIFT-84
>                 URL: https://issues.apache.org/jira/browse/THRIFT-84
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>            Reporter: Alexander Shigin
>         Attachments: thrift-fingerprint-sort.patch
>
>
> The next two struct produce different fingerprints:
> {code}
>     struct Bonk
>     {
>       2: i32 type
>       1: string message,
>     }
>     struct Bonk
>     {
>       1: string message,
>       2: i32 type
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-84) fingerprint depend on appearence order, not field identifiers

Posted by "Alexander Shigin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shigin updated THRIFT-84:
-----------------------------------

    Attachment: thrift-fingerprint-sort.patch

The attached patch solve the issue.

http://github.com/shigin/thrift/commit/787eec3abcdf435f4a87c4ec4555e02fcc6a84c0

> fingerprint depend on appearence order, not field identifiers
> -------------------------------------------------------------
>
>                 Key: THRIFT-84
>                 URL: https://issues.apache.org/jira/browse/THRIFT-84
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>            Reporter: Alexander Shigin
>         Attachments: thrift-fingerprint-sort.patch
>
>
> The next two struct produce different fingerprints:
> {code}
>     struct Bonk
>     {
>       2: i32 type
>       1: string message,
>     }
>     struct Bonk
>     {
>       1: string message,
>       2: i32 type
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-84) fingerprint depend on appearence order, not field identifiers

Posted by "Alexander Shigin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shigin resolved THRIFT-84.
------------------------------------

    Resolution: Duplicate

The issue was solved by THRIFT-236.

> fingerprint depend on appearence order, not field identifiers
> -------------------------------------------------------------
>
>                 Key: THRIFT-84
>                 URL: https://issues.apache.org/jira/browse/THRIFT-84
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>            Reporter: Alexander Shigin
>         Attachments: thrift-fingerprint-sort.patch
>
>
> The next two struct produce different fingerprints:
> {code}
>     struct Bonk
>     {
>       2: i32 type
>       1: string message,
>     }
>     struct Bonk
>     {
>       1: string message,
>       2: i32 type
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (THRIFT-84) fingerprint depend on appearence order, not field identifiers

Posted by "Alexander Shigin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shigin reopened THRIFT-84:
------------------------------------


Dense protocol is experimental, we can add 'old-fp' switch to thrift to use current fingerprint algorithm and raise a warning if 'old-fp' isn't equal to 'new-fp'. What do you think about it?

I think it's better to solve the problem while it still experimental. We want to use type 'any' in Rambler apps, and the type depend on fingerprint. 

> fingerprint depend on appearence order, not field identifiers
> -------------------------------------------------------------
>
>                 Key: THRIFT-84
>                 URL: https://issues.apache.org/jira/browse/THRIFT-84
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>            Reporter: Alexander Shigin
>         Attachments: thrift-fingerprint-sort.patch
>
>
> The next two struct produce different fingerprints:
> {code}
>     struct Bonk
>     {
>       2: i32 type
>       1: string message,
>     }
>     struct Bonk
>     {
>       1: string message,
>       2: i32 type
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.