-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
storage: recreate cio_stream if storage type is different(#8259) #8290
Conversation
cio_load creates storage stream if directory exists. It prevents to create memory stream by input plugins. This patch is to recreate stream if the type is different. Signed-off-by: Takahiro Yamashita <[email protected]>
src/flb_storage.c
Outdated
@@ -532,6 +532,18 @@ int flb_storage_input_create(struct cio_ctx *cio, | |||
return -1; | |||
} | |||
} | |||
else if (stream->type != cio_storage_type) { | |||
flb_info("[storage] storage type mismatch. input type=%s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will put this as a debug instead of info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case user environment is need to be fixed.
- Remove storage
- Modify storage property
I think it is better the level is info or warn to notice it.
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I would not remove the storage content for the user unless the directory is empty (no chunks), but I agree with better messaging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified log message. Could you check it ?
34c00a1
Signed-off-by: Takahiro Yamashita <[email protected]>
thank you |
fluent#8290) * storage: recreate cio_stream if storage type is different(fluent#8259) cio_load creates storage stream if directory exists. It prevents to create memory stream by input plugins. This patch is to recreate stream if the type is different. Signed-off-by: Takahiro Yamashita <[email protected]> * storage: modify log message Signed-off-by: Takahiro Yamashita <[email protected]> --------- Signed-off-by: Takahiro Yamashita <[email protected]>
fluent#8290) * storage: recreate cio_stream if storage type is different(fluent#8259) cio_load creates storage stream if directory exists. It prevents to create memory stream by input plugins. This patch is to recreate stream if the type is different. Signed-off-by: Takahiro Yamashita <[email protected]> * storage: modify log message Signed-off-by: Takahiro Yamashita <[email protected]> --------- Signed-off-by: Takahiro Yamashita <[email protected]> Signed-off-by: ahspw <[email protected]>
Fixes #8259
cio_load creates storage stream if directory exists before creating input chunks.
It prevents to create memory stream by input plugins.
This patch is to recreate stream if the stream type is different.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Configuration
Debug/Valgrind output
mkdir -p "$(pwd)/data/emitter.2"
fluent-bit -c a.conf
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.