Skip to content

TDBStore and NVStore should create an error if co exist. #9136

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

Merged
merged 6 commits into from
Jan 8, 2019

Conversation

yossi2le
Copy link
Contributor

Description

TDBStore and NVStore usually use the same flash address for storage and therefore should not be instantiated simultaneously in the same process.
This PR adds a checkup for NVStore and TDBStore to create a runtime error in case that both of them co-exist in the same application.

This PR is dependent on #9135

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@yossi2le yossi2le force-pushed the yossi_tdbstore_nvstore_co_exist branch from 87dd9e3 to 852b69d Compare December 18, 2018 13:35
@yossi2le yossi2le force-pushed the yossi_tdbstore_nvstore_co_exist branch from 852b69d to e511c48 Compare December 18, 2018 15:28
@cmonr cmonr requested a review from a team December 18, 2018 16:24
Copy link
Contributor

@offirko offirko left a comment

Choose a reason for hiding this comment

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

LGTM

static SingletonPtr<PlatformMutex> system_storage_mutex;

MBED_WEAK int set_internal_storage_ownership(internal_mem_resident_type_e in_mem_res, internal_mem_resident_type_e *out_mem_res)
{

Choose a reason for hiding this comment

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

Lets create a simpler function without parameters, with the mutex inside, named "avoid_conflict_nvstore_tdbstore"

Copy link
Contributor Author

@yossi2le yossi2le Dec 19, 2018

Choose a reason for hiding this comment

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

I have changed the name of the function and removed the output parameter

@yossi2le yossi2le force-pushed the yossi_tdbstore_nvstore_co_exist branch 3 times, most recently from 9882e84 to 1c8ef90 Compare December 19, 2018 14:03
@cmonr cmonr requested a review from AnotherButler December 19, 2018 17:48
@cmonr
Copy link
Contributor

cmonr commented Dec 19, 2018

Pinging @AnotherButler to look over the .md files.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

LGTM, pending docs review.

@cmonr
Copy link
Contributor

cmonr commented Dec 19, 2018

Whoops, nevermind. @AnotherButler no need to review this. The docs are already a part of #9135.

@yossi2le yossi2le force-pushed the yossi_tdbstore_nvstore_co_exist branch from 1c8ef90 to 677dbd1 Compare December 23, 2018 12:28
@NirSonnenschein
Copy link
Contributor

NirSonnenschein commented Dec 24, 2018

Technically could be ready for CI but as new commits were pushed @cmonr could you please take look to check it is still ok?

@NirSonnenschein
Copy link
Contributor

CI started pending review of new changes

@mbed-ci
Copy link

mbed-ci commented Dec 26, 2018

Test run: FAILED

Summary: 3 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@yossi2le
Copy link
Contributor Author

yossi2le commented Dec 26, 2018

The CI fail because it fails to build mbed-os-example-bootloader. I have issued a PR ARMmbed/mbed-os-example-bootloader#95 to fix the example and solve the issue.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 2, 2019

I removed CI as this still is waiting for preceeding PR

@yogpan01
Copy link
Contributor

yogpan01 commented Jan 7, 2019

@yossi2le Please merge #9135 and get this one also merged.
@0xc0170 please priortize these PRs as we need them to start testing on client side.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

@yossi2le Please merge #9135 and get this one also merged.

Merged, restarting CI here

@mbed-ci
Copy link

mbed-ci commented Jan 7, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@dannybenor
Copy link

@0xc0170 Can this be merged?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 9, 2019

Release label updated based on the agreement

@adbridge
Copy link
Contributor

adbridge commented Jan 14, 2019

@yossi2le @dannybenor
We may need to look at how you storage guys are developing and pushing your PRs as I am having immense problems trying to patch this over to 5.11 branch.
So the problem came down to the fact that both #9135 and this PR both contain the following commits:
1d71fb1
b8b7292
9590441
b17d13e

Now Github itself seems to be able to resolve the fact that those 4 commits already exist. But neither
git am or git cherry-pick can , so this causes major issues in our automation!

@davidsaada
Copy link
Contributor

@adbridge
Just to make sure we understand: the description of this PR says that it depends on #9135, so these commits will naturally be in both. So was the problem the missing rebase in this PR after #9135 was merged? As far as I manage to see, they were both merged in at the same time, so this was bound to happen. What are we missing?

@adbridge
Copy link
Contributor

@davidsaada yes I suspect this needed to be rebased after #9135 went in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants