ArticleslgStudy

computer science

Fencing (computing)

Fencing (computing) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Fencing (computing) rather than just read about it. In short: Fencing is the process of isolating a node of a computer cluster or protecting shared resources when a node appears to be malfunctioning. As the number of nodes in a cluster increases, so does the likelihood that one of them may fail at some point.

Fencing (computing) — main illustration
Fencing (computing) — illustration

Key takeaways

  • Fencing (computing) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Fencing (computing) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Fencing (computing) from memory before moving on to harder problems.

Reference excerpt

Fencing is the process of isolating a node of a computer cluster or protecting shared resources when a node appears to be malfunctioning. As the number of nodes in a cluster increases, so does the likelihood that one of them may fail at some point. The failed node may have control over shared resources that need to be reclaimed and if the node is acting erratically, the rest of the system needs to be protected. Fencing may thus either disable the node, or disallow shared storage access, thus ensuring data integrity.

Basic concepts A node fence (or I/O fence) is a virtual "fence" that separates nodes which must not have access to a shared resource from that resource. It may separate an active node from its backup. If the backup crosses the fence and, for example, tries to control the same disk array as the primary, a data hazard may occur. Mechanisms such as STONITH are designed to prevent this condition. Isolating a node means ensuring that I/O can no longer be done from it. Fencing is typically done automatically, by cluster infrastructure such as shared-disk file systems, in order to protect processes from other active nodes modifying the resources during node failures. Mechanisms to support fencing, such as the reserve/release mechanism of SCSI, have existed since at least 1985. Fencing is required because it is impossible to distinguish between a real failure and a temporary hang. If the malfunctioning node is really down, then it cannot do any damage, so theoretically no action would be required (it could simply be brought back into the cluster with the usual join process). However, because there is a possibility that a malfunctioning node could itself consider the rest of the cluster to be the one that is malfunctioning, a split brain condition could ensue, and cause data corruption. Instead, the system has to assume the worst scenario and always fence in case of problems.

Approaches to fencing There are two classes of fencing methods, one which disables a node itself, the other disallows access to resources such as shared disks. In some cases, it is assumed that if a node does not respond after a given time-threshold it may be assumed as non-operational, although there are counterexamples, e.g. a long paging rampage. The STONITH method stands for "Shoot The Other Node In The Head", meaning that the suspected node is disabled or powered off. For instance, power fencing uses a power controller to turn off an inoperable node. The node may then restart itself and join the cluster later. However, there are approaches in which an operator is informed of the need for a manual restart for the node. The resources fencing approach disallows access to resources without powering off the node. This may include:

Persistent reservation fencing uses the SCSI3 persistent reservations to block access to shared storage. Fibre Channel fencing disables the fibre channel port Global network block device (GNBD) fencing which disables access to the GNBD server When the cluster has only two nodes, the reserve/release method may be used as a two node STONITH whereby upon detecting that node B has 'failed', node A will issue the reserve and obtain all resources (e.g. shared disk) for itself. Node B will be disabled if it tries to do I/O (in case it was temporarily hung). On node B the I/O failure triggers some code to kill the node. Persistent reservation is essentially a match on a key, so the node which has the right key can do I/O, otherwise its I/O fails. Therefore, it is sufficient to change the key on a failure to ensure the right behavior during failure. However, it may not always be possible to change the key on the failed node. STONITH is an easier and simpler method to implement on multiple clusters, while the various approaches to resources fencing require specific implementation approaches for each cluster implementation.

STONITH STONITH (shoot the other node in the head or shoot the offending node in the head), sometimes called STOMITH (shoot the other member/machine in the head), is a technique for fencing in computer clusters. Google's inclusive language developer documentation discourages usage of this term, and recommends it is replaced with the term fence failed nodes. Fencing is the isolation of a failed node so that it does not cause disruption to a computer cluster. As its name suggests, STONITH fences failed nodes by resetting or powering down the failed node. Multi-node error-prone contention in a cluster can have catastrophic results, such as if both nodes try writing to a shared-storage resource. STONITH provides effective, if rather drastic, protection against these problems. Single node systems use a comparable mechanism called a watchdog timer. A watchdog timer will reset the node if the node does not tell the watchdog circuit that it is operating well. A STONITH decision can be based on various decisions which can be customer specific plugins.

See also Fault tolerance Failover

References

External links Red Hat GFS 6.0: Administrator's Guide - Using the Fencing System OCFS2 FAQ - Quorum and fencing

Illustrations

Fencing (computing): An NEC Nehalem cluster
An NEC Nehalem cluster

Worked examples

Example 1 — a first encounter with Fencing (computing)

Start with the simplest possible case. Write down what Fencing (computing) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Fencing (computing) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Fencing (computing) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Fencing (computing)

In research
Fencing (computing) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Fencing (computing) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Fencing (computing) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cluster computing, Fault-tolerant computer systems, so understanding it makes those chapters shorter.
In everyday life
Look for Fencing (computing) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Fencing (computing)” →

How to study Fencing (computing) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Fencing (computing) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Fencing (computing) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Fencing (computing) in simple terms?

Fencing is the process of isolating a node of a computer cluster or protecting shared resources when a node appears to be malfunctioning. As the number of nodes in a cluster increases, so does the likelihood that one of them may fail at some point.

Why does Fencing (computing) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Fencing (computing)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Fencing (computing).

Tags

  • Cluster computing
  • Fault-tolerant computer systems

Keep exploring