Skip to content

Conversation

@merlimat
Copy link
Contributor

@merlimat merlimat commented May 3, 2017

Motivation

Complete the steps described in #281.

In v1.17, (#282) ManagedLedger started supporting both text and binary versions of protobuf encoding for the metadata in ZK.

In v1.18, we can leave only the option for binary format. If a rollback to 1.17 becomes necessary, it won't be a problem since 1.17 can deserialize the binary format.

Modifications

Make binary format the only option for managed ledger metadata.

@merlimat merlimat added this to the 1.18 milestone May 3, 2017
@merlimat merlimat self-assigned this May 3, 2017
@merlimat merlimat requested review from rdhabalia and saandrews May 3, 2017 00:12
@merlimat merlimat force-pushed the remove-text-format branch from f2a7717 to 8eaf21e Compare May 3, 2017 18:24
@merlimat
Copy link
Contributor Author

@rdhabalia @saandrews Please take a look

Copy link
Contributor

Choose a reason for hiding this comment

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

We should handle it even if parsing text fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? If we cannot parse the protobuf we need to throw exception..

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't notice that the method is throwing exception. I was thinking that we are not handling the exception when it fails here.

@saandrews
Copy link
Contributor

The change looks good. We have to hold this pull request until we are ready with all the dependent tools to handle binary format.

@merlimat
Copy link
Contributor Author

The change looks good. We have to hold this pull request until we are ready with all the dependent tools to handle binary format.

The tool to get the ML metadata in text format is already in 1.17:

bin/pulsar-admin persistent info-internal $MY_TOPIC

@saandrews
Copy link
Contributor

Well, we have some internal tools as well :) I will merge it as soon as we are ready.

@merlimat
Copy link
Contributor Author

@saandrews any update on this one? Should we move to 1.19?

@saandrews
Copy link
Contributor

@merlimat Yeah, lets move it to 1.19

@merlimat
Copy link
Contributor Author

@saandrews sure, but let's try to get this in soon. This is reducing the ZK metadata footprint considerably. Also this gives freedom to update the metadata format without worrying about backward compatibility issues.

@merlimat merlimat modified the milestones: 1.19, 1.18 Jun 14, 2017
@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Jun 17, 2017
@merlimat merlimat force-pushed the remove-text-format branch from 8eaf21e to ec7a7e2 Compare June 23, 2017 23:19
@merlimat
Copy link
Contributor Author

merlimat commented Jul 5, 2017

@saandrews @rdhabalia Since #526 is already in, can we merge this one?

@merlimat
Copy link
Contributor Author

@saandrews @rdhabalia Ping

@rdhabalia
Copy link
Contributor

retest this please

@merlimat
Copy link
Contributor Author

@saandrews @rdhabalia Any update on this?

I'd like to add some new optional fields in the cursor protobuf data and it would be difficult to do it with the text format (for the schema migration and deployment rollback).

@saandrews
Copy link
Contributor

Maybe we can merge and defer this in our branch until we are ready(though won't prefer branching). @joefk ?

@joefk
Copy link
Contributor

joefk commented Aug 16, 2017

I am good with merging this.

@merlimat
Copy link
Contributor Author

I am good with merging this.

@joefk Still need "formal" PR approval, otherwise it cannot be merged 😃

Copy link
Contributor

@saandrews saandrews left a comment

Choose a reason for hiding this comment

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

We are good to go now :)

Copy link
Contributor

@rdhabalia rdhabalia left a comment

Choose a reason for hiding this comment

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

👍

@merlimat
Copy link
Contributor Author

🎉

@merlimat merlimat merged commit 3751baf into apache:master Aug 29, 2017
@merlimat merlimat deleted the remove-text-format branch August 29, 2017 17:42
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
* Support sendTimeout

* Substitute NonBlockIfQueueFull for BlockIfQueueFull

* Rename NonBlockIfQueueFull to DisableBlockIfQueueFull

* Replaced createdAt with sentAt which added in PR 397.

* Check and fail timeout messages before flushing batch

* Optimize code

* Remove redundant checking
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
### Motivation
The decode method in `KafkaEntryFormatter` is time-consuming among which the process of constructing `MemoryRecordsBuilder` takes the highest proportion of time. 

### Designing
Therefore our aims are:
1. overwrites `BaseOffset` field in byte buffer directly to avoid time-consuming iteration which is mainly used for assigning offsets
2. concatenates multiple record batches into one `MemoryRecords` object to better simulate kafka's behavior

### Modifications
- remove the iteration of continuously appending records in the `MemoryRecordsBuilder`
- change to one-to-one correspondence between batch and entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants