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

Add Lock's PdoStore documentation #9875

Closed
wants to merge 3 commits into from
Closed

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Jun 4, 2018

Documenting symfony/symfony#27456

@xabbuh xabbuh added the Waiting Code Merge Docs for features pending to be merged label Aug 7, 2018
@@ -195,7 +196,7 @@ PHP process is terminated::

Beware that some file systems (such as some types of NFS) do not support
locking. In those cases, it's better to use a directory on a local disk
drive or a remote store based on Redis or Memcached.
drive or a remote store based on Pdo, Redis or Memcached.
Copy link
Contributor

Choose a reason for hiding this comment

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

Pdo-> PDO

.. caution::

In a cluster configured with multiple master, ensure writes are
synchronously propaged to every nodes, or always use the same node.
Copy link
Contributor

Choose a reason for hiding this comment

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

propagated?


In order to purge old lock, this store use a current datetime to define a
expiration date reference. This mechanism relies on all client and server nodes
to have synchronized clock.
Copy link
Contributor

Choose a reason for hiding this comment

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

I read the code PR, is a synchronized clock still needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! indeed a previous version uses the client's clock. But it has been replaced by SGDB's time.

I removed the client from the sentence, as this is still the case for multi-master nodes


use Symfony\Component\Lock\Store\PdoStore;


Copy link
Member

Choose a reason for hiding this comment

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

extra blank line

PdoStore
~~~~~~~~~~

The PdoStore rely on the `ACID`_ properties of the SQL engine.
Copy link
Member

Choose a reason for hiding this comment

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

relies


.. caution::

In a cluster configured with multiple master, ensure writes are
Copy link
Member

Choose a reason for hiding this comment

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

multiple masters


.. caution::

Some SQL engine like MySQL allows to disable unique constraint check.
Copy link
Member

Choose a reason for hiding this comment

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

SQL engines ... allow ... disable the unique ...

Some SQL engine like MySQL allows to disable unique constraint check.
Ensure that this is not the case ``SET unique_checks=1;``.

In order to purge old lock, this store use a current datetime to define a
Copy link
Member

Choose a reason for hiding this comment

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

old locks, this store uses

Copy link
Member

Choose a reason for hiding this comment

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

an expiration


In order to purge old lock, this store use a current datetime to define a
expiration date reference. This mechanism relies on all server nodes to
have synchronized clock.
Copy link
Member

Choose a reason for hiding this comment

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

clocks


.. caution::

To ensure locks don't expire prematurely; the ttl's should be set with
Copy link
Member

Choose a reason for hiding this comment

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

TTLs

``Lock``, therefore this key must not be shared between processes (session,
Remote stores (:ref:`MemcachedStore <lock-store-memcached>`,
:ref:`PdoStore <lock-store-pdo>` and :ref:`RedisStore <lock-store-redis>`) use
an unique token to recognize the true owner of the lock. This token is stored
Copy link
Member

Choose a reason for hiding this comment

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

a unique

symfony-splitter pushed a commit to symfony/lock that referenced this pull request Sep 4, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[LOCK] Add a PdoStore

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25400
| License       | MIT
| Doc PR        | symfony/symfony-docs#9875

This is an alternative to #25578

Commits
-------

46fe1b0712 Add a PdoStore in lock
fabpot added a commit to symfony/symfony that referenced this pull request Sep 4, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[LOCK] Add a PdoStore

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25400
| License       | MIT
| Doc PR        | symfony/symfony-docs#9875

This is an alternative to #25578

Commits
-------

46fe1b0 Add a PdoStore in lock

.. caution::

In a cluster configured with multiple masters, ensure writes are
Copy link
Member Author

@jderusse jderusse Sep 4, 2018

Choose a reason for hiding this comment

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

Is it correct to use the word master (in the context master/slave database)?

ping @lsmith77 or @javiereguiluz

cf: redis/redis#3185

Copy link
Member

Choose a reason for hiding this comment

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

master/slave is a bad terminology (see https://twitter.com/dhh/status/1032268675674296320)

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, that's exactly my question, replaced by primaries

@javiereguiluz javiereguiluz added Lock and removed Waiting Code Merge Docs for features pending to be merged labels Sep 7, 2018
@javiereguiluz javiereguiluz added this to the 4.2 milestone Sep 7, 2018
@javiereguiluz
Copy link
Member

Thanks for contributing these docs Jérémy! They are merged now in time to prepare for Symfony 4.2 update. Thanks!

@jderusse jderusse deleted the lock-pdo branch April 18, 2020 10:10
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.

6 participants