Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-5041

RoundRobinPartitioner is not deterministic when order of input records change

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.17.0, 0.16.1
    • None
    • None
    • Reviewed

    Description

      Maps can be rerun due to shuffle fetch failures. Half of the reducers can end up successfully pulling partitions from first run of the map while other half could pull from the rerun after shuffle fetch failures. If the data is not partitioned by the Partitioner exactly the same way every time then it could lead to incorrect results (loss of records and duplicated records).

      There is a good probability of order of input records changing

      • With OrderedGroupedMergedKVInput (shuffle input), they keys are sorted but values can be in any order as the shuffle and merge depends on the order in which inputs are fetched. Anything involving FLATTEN can produce different order of output records.
      • With UnorderedKVInput, the records could be in any order depending on order of shuffle fetch.

      RoundRobinPartitioner can partition records differently everytime as order of input records change which is very bad. We need to get rid of RoundRobinPartitioner. Since the key is empty whenever we use RoundRobinPartitioner we need to partitioning based on hashcode of values to produce consistent partitioning.

      Partitioning based on hashcode is required for correctness, but disadvantage is that it

      • adds a lot of performance overhead with hashcode computation
      • with the random distribution due to hashcode (as opposed to batched round robin) input records sorted on some column could get distributed to different reducers and if union is followed by a store, the output can have bad compression.

      Attachments

        1. PIG-5041-1.patch
          8 kB
          Rohini Palaniswamy
        2. PIG-5041-2.patch
          10 kB
          Rohini Palaniswamy
        3. PIG-5041-branch0.16.patch
          10 kB
          Rohini Palaniswamy

        Activity

          People

            rohini Rohini Palaniswamy
            rohini Rohini Palaniswamy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: