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

Questions about FILEX's fault tolerant module #2

Open
SUM-L opened this issue Nov 17, 2023 · 1 comment
Open

Questions about FILEX's fault tolerant module #2

SUM-L opened this issue Nov 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@SUM-L
Copy link

SUM-L commented Nov 17, 2023

Questions about FILEX's fault tolerant module:

  1. If power is turned off at _fx_fault_tolerant_create_log_file, will FAT entry be lost and fewer FAT entries available?

  2. What if the log file is full?

How are the following scenarios handled?

1, if there are currently three files A.txt(1MB), B.txt(1MB) and C.txt(1MB), then the three threads open A.txt, B.txt, C.txt, respectively, to update data from a certain location of the file in the way of overwriting.

  1. Open a new file, write a fixed byte (such as 512B) of data each time, cycle until the size of 1GB, and then close the file.

  2. After the fault tolerant function is enabled, how do you handle the SD card switching between the FILEX file system of the module and the FAT32 file system of the computer? This scenario is common on pluggable storage devices.

@SUM-L SUM-L added the bug Something isn't working label Nov 17, 2023
@TiejunMS
Copy link
Contributor

If power is turned off at _fx_fault_tolerant_create_log_file, will FAT entry be lost and fewer FAT entries available?
Yes. It is possible to lose clusters those can be used.

What if the log file is full?
The size of calculated maximum log file is less than 2800 bytes. The capacity of log file is 3K. So it will never happen.

if there are currently three files A.txt(1MB), B.txt(1MB) and C.txt(1MB), then the three threads open A.txt, B.txt, C.txt, respectively, to update data from a certain location of the file in the way of overwriting.
Each FileX APIs are thread safe. They will not be executed simultaneously. See https://github.com/azure-rtos/filex/blob/3d6e7b0bb0f992b46e0b050281a6d52f09ecfbdd/ports/generic/inc/fx_port.h#L121

After the fault tolerant function is enabled, how do you handle the SD card switching between the FILEX file system of the module and the FAT32 file system of the computer? This scenario is common on pluggable storage devices.
As long as the transaction is completed on both FileX and Windows, the data on SD card can be modified on both sides.

@TiejunMS TiejunMS self-assigned this Nov 24, 2023
@eclipsewebmaster eclipsewebmaster transferred this issue from another repository Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants