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

fstore: hold more than 64 files #15

Open
wants to merge 1 commit into
base: 1.8
Choose a base branch
from

Conversation

matthewfala
Copy link
Owner


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:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

Documentation

  • Documentation required for this feature

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.


evict = files_up_add(fs, fsf);
if (evict != NULL) {
ret = cio_chunk_down(evict->chunk);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Add comment do describe unmapping

@@ -40,6 +40,7 @@ struct flb_fstore_file {
struct cio_chunk *chunk; /* chunk context */
struct cio_stream *stream; /* parent stream that owns this file */
struct mk_list _head; /* link to parent flb_fstore->files */
struct mk_list _cache_head; /* link to flb_fstore->files_up cache */

Choose a reason for hiding this comment

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

should we use the variable to _files_up_head?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I personally like _cache_head to remind that the _files_up list is used as a cache of up files, but can switch to _files_up_head.

_new->next = next;
_new->prev = prev;
prev->next = _new;
next->prev = _new; /* how is this a bug not found? is it really? */

Choose a reason for hiding this comment

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

as discussed, you can move this after row 78.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I forgot to change the corresponding PR on Monkey Server... So the solution that got accepted has the weird ordering... Shucks. At least it fixes the bug.

@@ -179,7 +179,7 @@ int s3_store_buffer_put(struct flb_s3 *ctx, struct s3_file *s3_file,
}

/* Append data to the target file */
ret = flb_fstore_file_append(fsf, data, bytes);
ret = flb_fstore_file_append(ctx->fs, fsf, data, bytes);

Choose a reason for hiding this comment

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

fsf used to be used as se_file->fsf. Why is the reason for using cts->fs directly here?

Copy link
Owner Author

@matthewfala matthewfala Jan 12, 2022

Choose a reason for hiding this comment

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

fs which is the file store context has the up list which needs to be updated on append. fs is found in the s3 context. The function signature needed to be altered accordingly.

*
* max of max_chunks_up files allowed before eviction of least recently added file
*/
static struct flb_fstore_file *files_up_add(struct flb_fstore *fs,

Choose a reason for hiding this comment

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

please comments on what is the expected return output and its meaning.

}

/* lets down file if needed, fsf must be brought up soon after by caller */
static int file_up_prep(struct flb_fstore *fs, /* previously files_up_make_room */

Choose a reason for hiding this comment

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

can we put more comments on what this function does and the meaning of return value?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Sure. Compared to Eduardo's functions my functions already have a lot of comments. Disregarding conformity, this should be fine.

*
* files_up record is reordered to put recently checked files first.
*/
static int file_up_if_down(struct flb_fstore *fs,

Choose a reason for hiding this comment

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

should we call file_mapped_if_down?

Copy link
Owner Author

Choose a reason for hiding this comment

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

IMO _up_ should be used preferably to _mapped_, because we are interfacing with the mmap syscall through chunkio api. The chunkio concept of up for files is mmap, but it is probably a good idea for the code to follow chunkio's concept abstraction

@matthewfala
Copy link
Owner Author

Unfortunately I made this branch to be immutable, since it is cherry picked from, so I'll have to update the code to resolve these comments on this branch/pr: #16

@matthewfala matthewfala mentioned this pull request Jan 12, 2022
4 tasks
@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants