Skip to content

feat: decouple partition location from executor metadata#1853

Open
sandugood wants to merge 5 commits into
apache:mainfrom
sandugood:feat/executor-info-decouple
Open

feat: decouple partition location from executor metadata#1853
sandugood wants to merge 5 commits into
apache:mainfrom
sandugood:feat/executor-info-decouple

Conversation

@sandugood

@sandugood sandugood commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #1851.

Rationale for this change

In the current implementation there is a problem - in the PartitionLocation that is used in each shuffle operation (for each partition in the previous stage) there was executor_metadata field (which is of ExecutorMetadata type) filled with unnecessary info, because it did not add up any information that could be used by ShuffleReaderExec to extract partition (or i.e resume the execution from a failed stage)

What changes are included in this PR?

ExecutorMetadata was decoupled from PartitionLocation and now it is used as a separate struct for:

  • registering executor
  • in heartbeats
  • REST API info fetch

PartitionLocation is now exposed only to the executor_id, host and port, which is sufficient for fetching needed partitions by the ShuffleReaderExec
This way we can save up a lot of space and data-transfer during each shuffle operation (potentially removing possibility of Scheduler's OOM errors and improving speed of queries with lots of partitions)

Are there any user-facing changes?

Yes.
In the REST API interface ExecutorResponse doesnt contain nested struct with Executor's hardware and OS info. It was flattened.

Potential follow-up:

  • check the TUI REST API integration

@sandugood sandugood changed the title feat: decouple partition's location from executor's metadata feat: decouple partition location from executor metadata Jun 9, 2026

@milenkovicm milenkovicm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contribution @sandugood

i think this is good first step, but we need to go a bit further and deduplicate executor connectivity information, is there a need to have same peace of information in thousents of places.

when we serialise PartitionLocation can we serialise it in two strucutres, vector of partition locations and a hash map of executor id -> executor metadata. partition location could reference executor with executor id (which we can store as bytes)

For struct PartitionLocation, can we make share executor_meta behind Arc (pub executor_meta: Arc<ExecutorMetadata>)

#[derive(Debug, Clone)]
pub struct PartitionLocation {
    /// The source partition ID from the map stage.
    pub map_partition_id: usize,
    /// The partition identifier.
    pub partition_id: PartitionId,
    /// Metadata about the executor hosting this partition.
    pub executor_meta: Arc<ExecutorMetadata>,
    /// Statistics about the partition data.
    pub partition_stats: PartitionStats,
    /// shuffle file id
    pub file_id: Option<u64>,
    /// whether this partition uses sort shuffle
    pub is_sort_shuffle: bool,
}

so basically when we do ser/de we can deduplicate executor meta.

Also, I'm not sure if flattening ExecutorSpecification and the other structure makes more sense than making it optional

This pr will need some effort, but it will help a lot cases where there is many partitions
thanks a lot

Comment thread ballista/core/proto/ballista.proto Outdated
Comment thread ballista/core/proto/ballista.proto
@sandugood

Copy link
Copy Markdown
Contributor Author

Thank you for your review and ideas @milenkovicm
Going to tackle it

@sandugood sandugood marked this pull request as draft June 10, 2026 12:01
@sandugood sandugood changed the title feat: decouple partition location from executor metadata [WIP] feat: decouple partition location from executor metadata Jun 10, 2026
@sandugood sandugood force-pushed the feat/executor-info-decouple branch from e5ac776 to 7fc0cea Compare June 16, 2026 09:54
@sandugood

Copy link
Copy Markdown
Contributor Author

Refactored the code:

  1. In the .proto spec now we are sending the PartitionLocation along with a map of ExecutorMetadata (used by ShuffleReaderPartition). So we can now transfer a Vec<> of locations and access the executor's metadata via its id.
  2. On the native side - added ExecutorMetadata in the PartitionLocation behind an Arc<> to avoid heavy copying.
  3. Made parts of the .proto spec in the ExecutorMetadata optional

@sandugood sandugood marked this pull request as ready for review June 16, 2026 10:27
@sandugood sandugood changed the title [WIP] feat: decouple partition location from executor metadata feat: decouple partition location from executor metadata Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExecutorMetatada too verbose

2 participants