-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for size-based output file rotation #42
Comments
Hey, @kempniu, I'm not much involved in fstrm development these days, but I wrote most of the original code. Can you point me to those "inelegant workarounds" for dnstap file rolling that you refer to in BIND? Just curious how libfstrm is currently being used in BIND. |
The following two functions come to mind specifically: Whenever it is determined that the dnstap output file is to be rolled, Meanwhile, IIUC, if fstrm supported size-based file rolling "natively", BIND worker threads could just shove data into a queue and let fstrm handle output file rolling. A lot of the complexity could then be removed from BIND, while (probably) not nearly as much code would need to be added to fstrm. But given the doubts surrounding size-based rolling itself, the question is whether more work should be put into supporting it properly (dropping support for size-based rolling altogether is also being considered). Hence me soliciting your opinion :) |
i think fstrm should support the ways people want to use it. |
@kempniu Yikes, BIND stops doing everything, like you have a giant lock on the whole server? It doesn't respond to queries while the files are being rolled? Since the fstrm What if you had something like this in the libfstrm API? typedef fstrm_res (*fstrm_iothr_writer_replace_callback)(struct fstrm_writer *old_writer,
struct fstrm_writer **new_writer,
void **user);
fstrm_res
fstrm_iothr_options_set_timed_writer_replace_callback(struct fstrm_iothr_options *opt,
unsigned replace_interval,
fstrm_iothr_writer_replace_callback,
void *user);
fstrm_res
fstrm_iothr_options_set_sized_writer_replace_callback(struct fstrm_iothr_options *opt,
uint64_t replace_nbytes,
fstrm_iothr_writer_replace_callback,
void *user); With the semantics being that you could provide two callbacks (each callback being a |
+1. |
Correct, that is what employing
The semantics you proposed seem very reasonable to me at this point. Anything allowing safe writer replacement inside an existing fstrm I/O thread should work. There is one more thing. BIND also allows the dnstap output file to be rolled "at will", using |
@kempniu I think BIND should figure out how to replace a pointer being used by multiple threads without needing to block the entire server, e.g. liburcu makes this pretty trivial. If you fixed BIND to not have a giant lock it doesn't appear that there would be a need to complicate the libfstrm API to do all this. |
BIND allows dnstap output files to be rolled when their size exceeds a configured limit. In order to make that possible, though, a set of inelegant workarounds are required in fstrm-related code. The only way to support such a feature in a clean manner seems to be to get it implemented in fstrm itself. Such an addition could potentially also be welcomed by other fstrm users.
This issue is not really a feature request, but rather a question: would support for size-based output file rolling be considered a welcome addition to fstrm's source code? I am aware that operational usefulness of size-based rolling can be questioned, but apparently there are people interested in using it. What is your opinion?
The text was updated successfully, but these errors were encountered: