Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOGBROKER-8840_create_topics_kafka_endpoint #747

Conversation

siarheivesialou
Copy link
Collaborator

@siarheivesialou siarheivesialou commented Dec 27, 2023

No description provided.

Copy link

github-actions bot commented Dec 27, 2023

Note

This is an automated comment that will be appended during run.

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 95346b4.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
59151 49953 0 17 9177 4

🔴 linux-x86_64-release-asan: some tests FAILED for commit 95346b4.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15297 15144 0 32 117 4

static const TString RETENTION_MS_CONFIG_NAME = "retention.ms";
static const TString RETENTION_BYTES_CONFIG_NAME = "retention.bytes";

class TKafkaCreateTopicRequest : public NKikimr::NGRpcService::IRequestOpCtx {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Возможно это надо вынести куда-нибудь выше. Вроде никак не связано с созданием , и можно будет переиспользовать в других акторах.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ага, это 100% ещё будет нужно в AlterConfigs.
Я добавил файл kafka_constants.h и вынес туда

for (auto& topic : Message->Topics) {
auto& topicName = topic.Name.value();

if (DuplicateTopicNames.contains(topicName)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Получается, что если топик указан два раза, то мы не попытаемся его даже создать. Так и задумывалось?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ага, если топик указали 2 раза - непонятно, какую из 2х конфигураций брать.
И ещё такая ситуация может возникнуть, если, например, не поменяли название топика при копипасте, поэтому опасно молча такое проглатывать

std::optional<ui64> retentionMs;
std::optional<ui64> retentionBytes;

auto parseRetention = [this, topic](
Copy link
Collaborator

Choose a reason for hiding this comment

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

А почему это лямбда, а не функция?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Мне больше нравится объявлять небольшие функции прямо там, где они используются. Так не принято? Если так, давай вынесу в метод

TCreateTopicsResponseData::TPtr response = std::make_shared<TCreateTopicsResponseData>();

for (auto& requestTopic : Message->Topics) {
auto topicName = requestTopic.Name.value();
Copy link
Collaborator

Choose a reason for hiding this comment

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

А это точно достаточная валидация? Или это для доработок потом?
(например, проверить правильный retaintion или существование топика)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Да, обсуждали с Лёшей, решили, что вообще не нужно запариваться - отвечать ОК на вообще всё
Если будет запрос на эту фичу - тогда и сделаем полноценную валидацию

response->TopicPath = TopicPath;
response->Message = message;
Send(Requester, response.Release());
Send(SelfId(), new TEvents::TEvPoisonPill());
Copy link
Collaborator

Choose a reason for hiding this comment

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

fyi TEvPoisonPill was deprecated. Use TEvPoison

@nshestakov nshestakov self-requested a review December 28, 2023 11:39
nshestakov
nshestakov previously approved these changes Dec 28, 2023

Verified

This commit was signed with the committer’s verified signature.
dlrobertson Dan Robertson
@siarheivesialou siarheivesialou merged commit 2c05227 into ydb-platform:main Dec 29, 2023
@siarheivesialou siarheivesialou deleted the LOGBROKER-8840_create_topics_kafka_endpoint branch December 29, 2023 11:25
@StekPerepolnen StekPerepolnen mentioned this pull request Dec 29, 2023
Closed
adameat pushed a commit to adameat/ydb that referenced this pull request Dec 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This was referenced Jan 3, 2024
This was referenced Jan 11, 2024
@vitstn vitstn mentioned this pull request Feb 16, 2024
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.

2 participants